From 7073ea4f0408e3f41ffdf622dbdf43e194c7351a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 31 Jul 2024 14:01:37 +0800 Subject: [PATCH] 1 --- webapp/controller/BattleController.class.php | 24 ++++++++++++++++++++ 1 file changed, 24 insertions(+) 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()