diff --git a/webapp/controller/QuestController.class.php b/webapp/controller/QuestController.class.php index 0d2f270..5415b66 100644 --- a/webapp/controller/QuestController.class.php +++ b/webapp/controller/QuestController.class.php @@ -347,7 +347,7 @@ class QuestController{ 'item_num' => $item_num, )); if ($item_id == 10001) { - $row = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', + $row1 = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', array( ':accountid' => $account_id )); @@ -355,7 +355,7 @@ class QuestController{ ' WHERE accountid=:accountid;', array( ':accountid' => $account_id, - ':coin_num' => $item_num + $row['coin_num'] + ':coin_num' => $item_num + $row1['coin_num'] )); } } else { @@ -365,7 +365,7 @@ class QuestController{ return; } $reward = $q['gold']; - $row = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', + $row1 = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', array( ':accountid' => $account_id )); @@ -373,7 +373,7 @@ class QuestController{ ' WHERE accountid=:accountid;', array( ':accountid' => $account_id, - ':coin_num' => $reward + $row['coin_num'] + ':coin_num' => $reward + $row1['coin_num'] )); } if ($row['quest_type'] == 1) { diff --git a/webapp/controller/SignController.class.php b/webapp/controller/SignController.class.php index be4a3e4..f6211a2 100644 --- a/webapp/controller/SignController.class.php +++ b/webapp/controller/SignController.class.php @@ -54,19 +54,6 @@ class SignController{ die(); return; } - echo json_encode(array( - 'errcode' => 0, - 'errmsg' => '', - 'game_times' => 0, - 'win_times' => 0, - 'high_kill' => 0, - 'kills' => 0, - 'high_harm' => 0, - 'harm' => 0, - 'add_HP' => 0, - 'alive_time' => 0, - 'coin_num' => 100000, - )); } $row = $conn->execQueryOne('SELECT * FROM sign WHERE accountid=:accountid;', array( @@ -91,11 +78,15 @@ class SignController{ $s = $this->getSign($sign_days + 90000); $item_id = $s['item_id']; $num = $s['num']; + $row2 = $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( ':accountid' => $account_id, - ':coin_num' => $num + ':coin_num' => $num + $row2['coin_num'] )); $quest = new classes\Quest(); $quest->triggerQuest(QUEST_DAY_LOGIN, 1, 1, $account_id); @@ -120,7 +111,7 @@ class SignController{ $s = $this->getSign($sign_days % 7 + 90000); $item_id = $s['item_id']; $num = $s['num']; - $row = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', + $row2 = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', array( ':accountid' => $account_id )); @@ -128,7 +119,7 @@ class SignController{ ' WHERE accountid=:accountid;', array( ':accountid' => $account_id, - ':coin_num' => $num + $row['coin_num'] + ':coin_num' => $num + $row2['coin_num'] )); //刷新每日任务 diff --git a/webapp/controller/SupplyBoxController.class.php b/webapp/controller/SupplyBoxController.class.php index 40a0c93..e7fbbdc 100644 --- a/webapp/controller/SupplyBoxController.class.php +++ b/webapp/controller/SupplyBoxController.class.php @@ -201,7 +201,7 @@ class SupplyBoxController{ 'item_num' => $item_num, )); if ($item_id == 10001) { - $row = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', + $row1 = $conn->execQueryOne('SELECT * FROM user WHERE accountid=:accountid;', array( ':accountid' => $account_id )); @@ -209,7 +209,7 @@ class SupplyBoxController{ ' WHERE accountid=:accountid;', array( ':accountid' => $account_id, - ':coin_num' => $item_num + $row['coin_num'] + ':coin_num' => $item_num + $row1['coin_num'] )); } $quest = new classes\Quest();