1
This commit is contained in:
commit
c9e895fb13
@ -445,17 +445,14 @@ class PayController{
|
|||||||
|
|
||||||
public function buyItem()
|
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) {
|
if (!$login) {
|
||||||
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
|
phpcommon\sendError(ERR_USER_BASE + 1, 'session无效');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$itemid = $_REQUEST['itemid'];
|
$itemid = $_REQUEST['itemid'];
|
||||||
$itemnum = $_REQUEST['itemnum'];
|
$itemnum = $_REQUEST['itemnum'];
|
||||||
// $itemid = 16002;
|
|
||||||
// $itemnum = 1;
|
|
||||||
|
|
||||||
$item_meta_table = require('../res/item@item.php');
|
$item_meta_table = require('../res/item@item.php');
|
||||||
$item_meta = getItemConfig($item_meta_table, $itemid);
|
$item_meta = getItemConfig($item_meta_table, $itemid);
|
||||||
@ -468,7 +465,7 @@ class PayController{
|
|||||||
'account_id' => $_REQUEST['account_id'],
|
'account_id' => $_REQUEST['account_id'],
|
||||||
'itemid' => $itemid,
|
'itemid' => $itemid,
|
||||||
'itemnum' => 1,
|
'itemnum' => 1,
|
||||||
'price' => SERVER_ENV != _ONLINE ? 0.01 : (float)$item_meta['rmbprice']
|
'price' => (float)$item_meta['rmbprice']
|
||||||
);
|
);
|
||||||
$timestamp = time();
|
$timestamp = time();
|
||||||
$params['sign'] = phpcommon\md5Sign($params, '06ba97e28ea905b0b7ed5477746b07f1', $timestamp);
|
$params['sign'] = phpcommon\md5Sign($params, '06ba97e28ea905b0b7ed5477746b07f1', $timestamp);
|
||||||
@ -492,7 +489,8 @@ class PayController{
|
|||||||
}
|
}
|
||||||
|
|
||||||
$conn = $this->getMysql($_REQUEST['account_id']);
|
$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(
|
array(
|
||||||
':orderid' => $_REQUEST['orderid']
|
':orderid' => $_REQUEST['orderid']
|
||||||
));
|
));
|
||||||
@ -508,18 +506,9 @@ class PayController{
|
|||||||
'errcode' => 0,
|
'errcode' => 0,
|
||||||
'errmsg'=> '',
|
'errmsg'=> '',
|
||||||
'order_state' => 0,
|
'order_state' => 0,
|
||||||
'buy_itemid' => 0,
|
'buy_itemid' => $row[3],
|
||||||
'buy_itemnum' => 0,
|
'buy_itemnum' => 1,
|
||||||
'item_list' => array(
|
'item_list' => json_decode($row[2], true)
|
||||||
array(
|
|
||||||
'itemid' => 10001,
|
|
||||||
'itemnum' => 1000,
|
|
||||||
),
|
|
||||||
array(
|
|
||||||
'itemid' => 10003,
|
|
||||||
'itemnum' => 1000,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user