From 44bbb3fc13e0157f9e3f9dae3242de7de822cac0 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Mon, 21 Nov 2022 16:16:39 +0800 Subject: [PATCH] 1 --- webapp/controller/BattleController.class.php | 4 ++-- webapp/models/Bag.php | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index c7375f83..a669024f 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -227,12 +227,12 @@ class BattleController extends BaseAuthedController { } } { - $itemDb = Bag::find(V_ITEM_REVIVE_COIN); + $itemDb = Bag::findEx($member['account_id'], V_ITEM_REVIVE_COIN); $info['revive_coin'] = $itemDb && $itemDb['item_num'] > 0 ? $itemDb['item_num'] : 0; } { $info['match_mode'] = 0; - if ($currSeason && myself()->_getV(TN_RANK_STATUS, 0 ) == 0){ + if ($currSeason && myself()->_getV(TN_RANK_STATUS, 0) == 0){ $info['match_mode'] = 1; } } diff --git a/webapp/models/Bag.php b/webapp/models/Bag.php index 1d7405e5..98851ac5 100644 --- a/webapp/models/Bag.php +++ b/webapp/models/Bag.php @@ -34,6 +34,22 @@ class Bag extends BaseModel { return $row; } + public static function findEx($accountId, $itemId) + { + $row = SqlHelper::ormSelectOne( + myself()->_getMysql($accountId), + 't_bag', + array( + 'account_id' => $accountId, + 'item_id' => $itemId, + ) + ); + if ($row) { + $row['item_uniid'] = $row['idx']; + } + return $row; + } + public static function findByUniId($itemUniId) { $row = SqlHelper::ormSelectOne(