diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 206eb92c..273c217b 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -1255,6 +1255,30 @@ class BattleController extends BaseAuthedController { $roomUuid = getReqVal('room_uuid', ''); $usedNum = getReqVal('used_num', 0); $allocBoxNum = getReqVal('alloc_box_num', 0); + $row = SqlHelper::ormSelectOne( + $this->_getSelfMysql(), + 't_box_alloc', + array( + 'room_uuid' => $roomUuid, + ) + ); + if (empty($row)) { + myself()->_rspOk(); + return; + } + SqlHelper::update( + $this->_getSelfMysql(), + 't_box_alloc', + array( + 'room_uuid' => $roomUuid, + ), + array( + 'used_num' => $usedNum, + 'return_account_id' => myself()->_getAccountId(), + 'return_time' => myself()->_getNowTime(), + ) + ); + myself()->_rspOk(); } private function getAlreadyAllocBoxNum()