1
This commit is contained in:
parent
039323a969
commit
3a65766e2a
@ -352,11 +352,11 @@ class QuestController{
|
|||||||
':accountid' => $account_id
|
':accountid' => $account_id
|
||||||
));
|
));
|
||||||
$ret = $conn->execScript('UPDATE user SET coin_num=:coin_num ' .
|
$ret = $conn->execScript('UPDATE user SET coin_num=:coin_num ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':accountid' => $account_id,
|
||||||
':coin_num' => $item_num + $row['coin_num']
|
':coin_num' => $item_num + $row['coin_num']
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$q = $this->getQuest($quest_id);
|
$q = $this->getQuest($quest_id);
|
||||||
@ -365,6 +365,10 @@ class QuestController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$reward = $q['gold'];
|
$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 ' .
|
$ret = $conn->execScript('UPDATE user SET coin_num=:coin_num ' .
|
||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
|
@ -271,11 +271,11 @@ class SupplyBoxController{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$row = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;',
|
$row1 = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id
|
':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, '金币不足');
|
phpcommon\sendError(ERR_USER_BASE + 3, '金币不足');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -283,7 +283,7 @@ class SupplyBoxController{
|
|||||||
' WHERE accountid=:accountid;',
|
' WHERE accountid=:accountid;',
|
||||||
array(
|
array(
|
||||||
':accountid' => $account_id,
|
':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;
|
$buy_times = $row['buy_times'] + 1;
|
||||||
$box_num = $row['box_num'] + 1;
|
$box_num = $row['box_num'] + 1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user