This commit is contained in:
wangwei01 2019-05-07 17:26:51 +08:00
parent 039323a969
commit 3a65766e2a
2 changed files with 12 additions and 8 deletions

View File

@ -365,6 +365,10 @@ class QuestController{
return;
}
$reward = $q['gold'];
$row = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
$ret = $conn->execScript('UPDATE user SET coin_num=:coin_num ' .
' WHERE accountid=:accountid;',
array(

View File

@ -271,11 +271,11 @@ class SupplyBoxController{
return;
}
} else {
$row = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;',
$row1 = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;',
array(
':accountid' => $account_id
));
if ($row['coin_num'] < $s['price'] * pow($s['parameter'], ($row['box_num'] - 1))) {
if ($row1['coin_num'] < $s['price'] * pow($s['parameter'], ($row['box_num'] - 1))) {
phpcommon\sendError(ERR_USER_BASE + 3, '金币不足');
return;
}
@ -283,7 +283,7 @@ class SupplyBoxController{
' WHERE accountid=:accountid;',
array(
':accountid' => $account_id,
':coin_num' => $row['coin_num'] - ($s['price'] * pow($s['parameter'], ($row['box_num'] - 1)))
':coin_num' => $row1['coin_num'] - ($s['price'] * pow($s['parameter'], ($row['box_num'] - 1)))
));
$buy_times = $row['buy_times'] + 1;
$box_num = $row['box_num'] + 1;