From 41ca8e812114b0b8303f7edfeeea371399dce47b Mon Sep 17 00:00:00 2001 From: tping Date: Fri, 13 Mar 2020 16:32:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BD=99=E9=A2=9D=E7=BB=91?= =?UTF-8?q?=E5=B8=81=E6=98=8E=E7=BB=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Application/Callback/Controller/BaseController.class.php | 2 +- Application/Sdk/Controller/PayH5Controller.class.php | 6 +++--- Application/Sdk/Model/ValueDetailLogModel.class.php | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Application/Callback/Controller/BaseController.class.php b/Application/Callback/Controller/BaseController.class.php index 3fa320b6..44246c2c 100644 --- a/Application/Callback/Controller/BaseController.class.php +++ b/Application/Callback/Controller/BaseController.class.php @@ -247,7 +247,7 @@ class BaseController extends Controller { $before = $userInfo['balance']; $after = $before + $d['pay_amount']; $valueDetailLogModel = new \Sdk\Model\ValueDetailLogModel(); - $valueDetailLogModel->add($d['user_id'], $before, $d['pay_amount'], $after, $valueDetailLogModel::BALANCE, "平台币抵扣".$d['pay_amount']); + $valueDetailLogModel->addLog($d['user_id'], $data['trade_no'], $before, $d['pay_amount'], $after, $valueDetailLogModel::BALANCE, "平台币抵扣".$d['pay_amount']); $user->where("id=".$d['user_id'])->setInc("balance",$d['pay_amount']); $user->where("id=".$d['user_id'])->setInc("cumulative",$d['pay_amount']); diff --git a/Application/Sdk/Controller/PayH5Controller.class.php b/Application/Sdk/Controller/PayH5Controller.class.php index f1743fb8..179e23ed 100644 --- a/Application/Sdk/Controller/PayH5Controller.class.php +++ b/Application/Sdk/Controller/PayH5Controller.class.php @@ -1080,14 +1080,14 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`; $user_play->where($user_play_map)->save(array('bind_balance' => 0)); // 扣绑定币 $request['price'] = $user_play_data['bind_balance']; $result = $this->add_spend($request); - $valueDetailLogModel->add($request['user_id'], $user_play_data['bind_balance'], -$user_play_data['bind_balance'], 0, $valueDetailLogModel::BANDBI, "绑定币消费:".$user_play_data['pay_amount']); + $valueDetailLogModel->addLog($request['user_id'], $request['pay_order_number'], $user_play_data['bind_balance'], -$user_play_data['bind_balance'], 0, $valueDetailLogModel::BANDBI, "绑定币消费:".$user_play_data['pay_amount']); $this->set_ratio($request['pay_order_number'], 2); // 游戏返利 $notice_order[] = $request['pay_order_number']; } $request['pay_order_number'] = $pay_order_number; $request['pay_way'] = 0; // 扣平台币 $real_price = $price - $user_play_data['bind_balance']; - $valueDetailLogModel->add($request['user_id'], $balance, -$real_price, 0, $valueDetailLogModel::BALANCE, "平台币消费:".$real_price); + $valueDetailLogModel->addLog($request['user_id'], $request['pay_order_number'], $balance, -$real_price, 0, $valueDetailLogModel::BALANCE, "平台币消费:".$real_price); $user->where(array('id' => $request["user_id"]))->setDec("balance", $real_price); //$this->set_message(0,"fail", $request['pay_order_number']); @@ -1096,7 +1096,7 @@ ADD COLUMN `pay_url` text NULL AFTER `check_sign`; $this->set_ratio($request['pay_order_number'], 1); // 游戏返利 $notice_order[] = $request['pay_order_number']; } else { // 绑定币足够扣 - $valueDetailLogModel->add($request['user_id'], $user_play_data['bind_balance'], -$request['price'], $user_play_data['bind_balance'] - $request['price'], $valueDetailLogModel::BANDBI, "绑定币消费.:".$request['price']); + $valueDetailLogModel->addLog($request['user_id'], $request['pay_order_number'], $user_play_data['bind_balance'], -$request['price'], $user_play_data['bind_balance'] - $request['price'], $valueDetailLogModel::BANDBI, "绑定币消费.:".$request['price']); $user_play->where($user_play_map)->setDec('bind_balance', $request['price']); // 扣绑定币 $result = $this->add_spend($request); diff --git a/Application/Sdk/Model/ValueDetailLogModel.class.php b/Application/Sdk/Model/ValueDetailLogModel.class.php index 7fe94deb..d1cc056d 100644 --- a/Application/Sdk/Model/ValueDetailLogModel.class.php +++ b/Application/Sdk/Model/ValueDetailLogModel.class.php @@ -30,8 +30,9 @@ class ValueDetailLogModel extends Model { } // 新增数值变动记录 - public function add($uid, $before, $value, $after, $type, $remark='', $payType=1) { - $this->add(array( + public function addLog($uid, $orderNumber, $before, $value, $after, $type, $remark='', $payType=1) { + $this->add(array( + 'order_number' => $orderNumber, 'user_id' => $uid, 'before_value' => $before, 'value' => $value,