diff --git a/third_party/phpcommon b/third_party/phpcommon index 1e3bb4d..e04c7c8 160000 --- a/third_party/phpcommon +++ b/third_party/phpcommon @@ -1 +1 @@ -Subproject commit 1e3bb4df855f6d11df75545d10b0c2aacea34a06 +Subproject commit e04c7c832abfe671ac35ba2ea43f24071ff06582 diff --git a/webapp/controller/PayController.class.php b/webapp/controller/PayController.class.php index 00eeb94..13400e9 100644 --- a/webapp/controller/PayController.class.php +++ b/webapp/controller/PayController.class.php @@ -1,5 +1,7 @@ $minigame_appid, ':minigame_accountid' => $minigame_accountid, )); + { + $log_params = array( + '#account_id' => $game_account_id, + '#distinct_id' => '', + '#type' => 'track', + '#time' => date("Y-m-d H:i:s"), + '#ip' => phpcommon\getIPv4(), + '#event_name' => 'event_' . 11 . '_' . 40, + + 'properties' => array( + 'channel' => $game_channel, + 'gameid' => $gameid, + 'orderid' => $orderid, + 'itemid' => $itemid, + 'itemnum' => 1, + 'amount' => $real_amount, + 'sp_orderid' => (string)$xmlobj->OrderNo, + 'minigame_appid' => $minigame_appid, + 'minigame_account_id' => $minigame_accountid, + ) + ); + phpcommon\TGLog::writeToLog('gamepay', $gameid, $log_params); + } if (!$ret) { echo json_encode(array( 'errcode' => 2, diff --git a/webapp/controller/PayNotifyController.class.php b/webapp/controller/PayNotifyController.class.php index b022323..f98c10b 100644 --- a/webapp/controller/PayNotifyController.class.php +++ b/webapp/controller/PayNotifyController.class.php @@ -1,5 +1,7 @@ time() )); if ($_REQUEST['Succeed'] == '88') { - $row = $conn->execQueryOne('SELECT orderid, accountid, sp_pay_result, status FROM orderinfo ' . + $row = $conn->execQueryOne('SELECT orderid, accountid, sp_pay_result, status, channel, '. + ' gameid, itemid, price '. + 'FROM orderinfo ' . 'WHERE orderid=:orderid;', array( 'orderid' => $_REQUEST['BillNo'] ) ); if ($row) { + { + $log_params = array( + '#account_id' => $row['accountid'], + '#distinct_id' => '', + '#type' => 'track', + '#time' => date("Y-m-d H:i:s"), + '#ip' => phpcommon\getIPv4(), + '#event_name' => 'event_' . 11 . '_' . 41, + + 'properties' => array( + 'channel' => $row['channel'], + 'gameid' => $row['gameid'], + 'orderid' => $row['orderid'], + 'itemid' => $row['itemid'], + 'itemnum' => 1, + 'amount' => $row['price'], + 'sp_orderid' => $_REQUEST['OrderNo'], + 'sp_amount' => $_REQUEST['Amount'], + ) + ); + phpcommon\TGLog::writeToLog('gamepay', $row['gameid'], $log_params); + } if ($row['status'] == 0 && $row['sp_pay_result'] == 0) { $ret = $conn->execScript('INSERT INTO confirmed_order(orderid, status, createtime)' . 'VALUES(:orderid, :status, :createtime);',