This commit is contained in:
yangduo 2025-01-14 14:56:28 +08:00
parent 2b9ac51612
commit 625a2335b4

View File

@ -339,10 +339,10 @@ class RechargeController
'orderid' => $_REQUEST['orderid'], 'orderid' => $_REQUEST['orderid'],
'amount' => $_REQUEST['amount'], 'amount' => $_REQUEST['amount'],
); );
$oristr = 'account_id='.$_REQUEST['account_id'].'&goodsid='.$_REQUEST['goodsid'].'&orderid='.$_REQUEST['orderid'].'&amount='.$_REQUEST['amount'].':'.$_REQUEST['timestamp'].'NrN3zkVOzXF1vRzUc9eJM9ZKRO5eLooD'; $oristr = 'account_id=' . $_REQUEST['account_id'] . '&goodsid=' . $_REQUEST['goodsid'] . '&orderid=' . $_REQUEST['orderid'] . '&amount=' . $_REQUEST['amount'] . ':' . $_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('src:'.$oristr.'|'.$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(
@ -494,11 +494,37 @@ class RechargeController
); );
} }
} else { } else {
$item_list = $addreward->addReward($shopgoods['item_id'], 1, $_REQUEST['account_id'], 0, 0); $itemconf = metatable\getItemById($shopgoods['item_id']);
if (!$itemconf) {
foreach ($item_list as &$value) { error_log('game2004api purchaseNotify daily goods config error:' . json_encode($_REQUEST));
$value['itemnum'] = (float)$value['itemnum']; echo json_encode(array(
'errcode' => 4,
'errmsg' => 'privilege card error 2'
));
die();
} }
$dropconf = $this->getDrop($itemconf['fuctionindex']);
if (!$dropconf) {
error_log('game2004api purchaseNotify daily goods config error 1:' . json_encode($_REQUEST));
echo json_encode(array(
'errcode' => 4,
'errmsg' => 'privilege card error 3'
));
die();
}
$itemidlist = explode('|', $dropconf['item_id']);
$itemnumlist = explode('|', $dropconf['item_num']);
$item_list = array();
foreach ($itemidlist as $key => $itemid) {
array_push($item_list, array(
'item_id' => $itemid,
'item_num' => $itemnumlist[$key],
'time' => 0,
));
$addreward->addReward($itemid, $itemnumlist[$key], $account_id, 0, 0);
}
error_log(json_encode($item_list)); error_log(json_encode($item_list));
//update daily purchase //update daily purchase
@ -840,7 +866,7 @@ class RechargeController
$itemnumlist = explode('|', $dropconf['num']); $itemnumlist = explode('|', $dropconf['num']);
$addreward = new classes\AddReward(); $addreward = new classes\AddReward();
$all_item_list = array(); $all_item_list = array();
foreach ($itemidlist as $index => $itemid) { foreach ($itemidlist as $key => $itemid) {
array_push($item_list, array( array_push($item_list, array(
'item_id' => $itemid, 'item_id' => $itemid,
'item_num' => $itemnumlist[$key], 'item_num' => $itemnumlist[$key],