adjust
This commit is contained in:
parent
dbd068c407
commit
c59db09ed9
@ -346,7 +346,7 @@ class RechargeController
|
|||||||
':' + $_REQUEST['timestamp'] + 'NrN3zkVOzXF1vRzUc9eJM9ZKRO5eLooD';
|
':' + $_REQUEST['timestamp'] + 'NrN3zkVOzXF1vRzUc9eJM9ZKRO5eLooD';
|
||||||
// $sign = phpcommon\md5Sign($params, 'NrN3zkVOzXF1vRzUc9eJM9ZKRO5eLooD', $_REQUEST['timestamp']);
|
// $sign = phpcommon\md5Sign($params, 'NrN3zkVOzXF1vRzUc9eJM9ZKRO5eLooD', $_REQUEST['timestamp']);
|
||||||
$sign = md5($oristr);
|
$sign = md5($oristr);
|
||||||
error_log($sign + '|' + $_REQUEST['sign']);
|
error_log('src:'.$oristr.'|'.$sign.'|'.$_REQUEST['sign']);
|
||||||
if ($sign != $_REQUEST['sign']) {
|
if ($sign != $_REQUEST['sign']) {
|
||||||
error_log('game2004api payNotify sign error:' + $sign + '|' + json_encode($_REQUEST));
|
error_log('game2004api payNotify sign error:' + $sign + '|' + json_encode($_REQUEST));
|
||||||
echo json_encode(array(
|
echo json_encode(array(
|
||||||
@ -391,8 +391,23 @@ class RechargeController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$nowtime = time();
|
|
||||||
$conn = $this->getMysql($_REQUEST['account_id']);
|
$conn = $this->getMysql($_REQUEST['account_id']);
|
||||||
|
|
||||||
|
$orderRow = $conn->execQueryOne(
|
||||||
|
'SELECT * FROM orderinfo WHERE orderid=:orderid',
|
||||||
|
array(
|
||||||
|
':orderid' => $_REQUEST['orderid']
|
||||||
|
)
|
||||||
|
);
|
||||||
|
if (!$orderRow) {
|
||||||
|
echo json_encode(array(
|
||||||
|
'errcode' => 0,
|
||||||
|
'errmsg' => ''
|
||||||
|
));
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
|
$nowtime = time();
|
||||||
$this->insertNewOrder($conn, $nowtime);
|
$this->insertNewOrder($conn, $nowtime);
|
||||||
$this->updateUserTable($conn);
|
$this->updateUserTable($conn);
|
||||||
$this->addToBuyHis($conn, $nowtime);
|
$this->addToBuyHis($conn, $nowtime);
|
||||||
@ -551,7 +566,7 @@ class RechargeController
|
|||||||
$ret = $conn->execScript(
|
$ret = $conn->execScript(
|
||||||
'INSERT INTO orderinfo(accountid, orderid, goodsid, price, ' .
|
'INSERT INTO orderinfo(accountid, orderid, goodsid, price, ' .
|
||||||
' create_time, modify_time)' .
|
' create_time, modify_time)' .
|
||||||
'VALUES(:accountid, :orderid, :goodsid, :price, ' .
|
' VALUES(:accountid, :orderid, :goodsid, :price, ' .
|
||||||
' :create_time, :modify_time);',
|
' :create_time, :modify_time);',
|
||||||
array(
|
array(
|
||||||
':accountid' => $_REQUEST['account_id'],
|
':accountid' => $_REQUEST['account_id'],
|
||||||
@ -574,7 +589,7 @@ class RechargeController
|
|||||||
private function updateUserTable($conn)
|
private function updateUserTable($conn)
|
||||||
{
|
{
|
||||||
$ret = $conn->execScript(
|
$ret = $conn->execScript(
|
||||||
'UPDATE user SET recharge_times_total=recharge_times_total + 1, ' .
|
'UPDATE user SET recharge_times_total=recharge_times_total + 1 ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $_REQUEST['account_id'],
|
':accountid' => $_REQUEST['account_id'],
|
||||||
@ -588,9 +603,9 @@ class RechargeController
|
|||||||
$conn->execScript(
|
$conn->execScript(
|
||||||
'INSERT INTO buy_his(accountid, goodsid, sum_times, today_times, ' .
|
'INSERT INTO buy_his(accountid, goodsid, sum_times, today_times, ' .
|
||||||
' last_buy_time, create_time, modify_time)' .
|
' last_buy_time, create_time, modify_time)' .
|
||||||
'VALUES(:accountid, :goodsid, 1, 1, ' .
|
' VALUES(:accountid, :goodsid, 1, 1, ' .
|
||||||
' :last_buy_time, :create_time, :modify_time)' .
|
' :last_buy_time, :create_time, :modify_time)' .
|
||||||
'ON DUPLICATE KEY UPDATE sum_times=sum_times + 1, ' .
|
' ON DUPLICATE KEY UPDATE sum_times=sum_times + 1, ' .
|
||||||
' modify_time=:modify_time, last_buy_time=:last_buy_time,' .
|
' modify_time=:modify_time, last_buy_time=:last_buy_time,' .
|
||||||
' today_times=' .
|
' today_times=' .
|
||||||
" CASE WHEN last_buy_time < $dayseconds THEN 1 ELSE today_times + 1 END;",
|
" CASE WHEN last_buy_time < $dayseconds THEN 1 ELSE today_times + 1 END;",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user