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'],
'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 = md5($oristr);
error_log('src:'.$oristr.'|'.$sign.'|'.$_REQUEST['sign']);
error_log('src:' . $oristr . '|' . $sign . '|' . $_REQUEST['sign']);
if ($sign != $_REQUEST['sign']) {
error_log('game2004api payNotify sign error:' + $sign + '|' + json_encode($_REQUEST));
echo json_encode(array(
@ -494,11 +494,37 @@ class RechargeController
);
}
} else {
$item_list = $addreward->addReward($shopgoods['item_id'], 1, $_REQUEST['account_id'], 0, 0);
foreach ($item_list as &$value) {
$value['itemnum'] = (float)$value['itemnum'];
$itemconf = metatable\getItemById($shopgoods['item_id']);
if (!$itemconf) {
error_log('game2004api purchaseNotify daily goods config error:' . json_encode($_REQUEST));
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));
//update daily purchase
@ -840,7 +866,7 @@ class RechargeController
$itemnumlist = explode('|', $dropconf['num']);
$addreward = new classes\AddReward();
$all_item_list = array();
foreach ($itemidlist as $index => $itemid) {
foreach ($itemidlist as $key => $itemid) {
array_push($item_list, array(
'item_id' => $itemid,
'item_num' => $itemnumlist[$key],