This commit is contained in:
wangwei01 2019-08-23 17:01:51 +08:00
commit c9e895fb13

View File

@ -445,17 +445,14 @@ class PayController{
public function buyItem()
{
$account_id = $_REQUEST['account_id'];
//登录校验
$login = loginVerify($account_id, $_REQUEST['session_id']);
$login = loginVerify($_REQUEST['account_id'], $_REQUEST['session_id']);
if (!$login) {
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
return;
}
$itemid = $_REQUEST['itemid'];
$itemnum = $_REQUEST['itemnum'];
// $itemid = 16002;
// $itemnum = 1;
$item_meta_table = require('../res/item@item.php');
$item_meta = getItemConfig($item_meta_table, $itemid);
@ -468,7 +465,7 @@ class PayController{
'account_id' => $_REQUEST['account_id'],
'itemid' => $itemid,
'itemnum' => 1,
'price' => SERVER_ENV != _ONLINE ? 0.01 : (float)$item_meta['rmbprice']
'price' => (float)$item_meta['rmbprice']
);
$timestamp = time();
$params['sign'] = phpcommon\md5Sign($params, '06ba97e28ea905b0b7ed5477746b07f1', $timestamp);
@ -492,7 +489,8 @@ class PayController{
}
$conn = $this->getMysql($_REQUEST['account_id']);
$row = $conn->execQueryOne('SELECT orderid, status FROM orderinfo WHERE orderid=:orderid;',
$row = $conn->execQueryOne('SELECT orderid, status, item_list, itemid ' .
'FROM orderinfo WHERE orderid=:orderid;',
array(
':orderid' => $_REQUEST['orderid']
));
@ -508,18 +506,9 @@ class PayController{
'errcode' => 0,
'errmsg'=> '',
'order_state' => 0,
'buy_itemid' => 0,
'buy_itemnum' => 0,
'item_list' => array(
array(
'itemid' => 10001,
'itemnum' => 1000,
),
array(
'itemid' => 10003,
'itemnum' => 1000,
),
)
'buy_itemid' => $row[3],
'buy_itemnum' => 1,
'item_list' => json_decode($row[2], true)
));
}