From e61198c2a87631b7f316230accd53996c641aaa4 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 26 Dec 2023 13:54:37 +0800 Subject: [PATCH] 1 --- webapp/bootstrap/constant.php | 2 +- webapp/controller/MatchController.class.php | 21 ++++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/webapp/bootstrap/constant.php b/webapp/bootstrap/constant.php index ff8a3732..8d053a81 100644 --- a/webapp/bootstrap/constant.php +++ b/webapp/bootstrap/constant.php @@ -6,7 +6,7 @@ define('DAILY_SELECTION_KEY', 'game2006api:daily_selection:'); define('PLANET_BUY_KEY', 'game2006api:planet_buy:'); define('LAST_SESSION_KEY', 'last_session:'); -define('MATCH_KEY', 'match:'); +define('MATCH_CURRENT_TEAM_KEY', 'match:current_team:'); define('V_ITEM_GOLD', 10001); //金币 define('V_ITEM_DIAMOND', 10014); //钻石 diff --git a/webapp/controller/MatchController.class.php b/webapp/controller/MatchController.class.php index f5a9afc4..2938b405 100644 --- a/webapp/controller/MatchController.class.php +++ b/webapp/controller/MatchController.class.php @@ -13,7 +13,6 @@ require_once('mt/StarLevel.php'); require_once('services/PropertyChgService.php'); - use phpcommon\SqlHelper; use models\User; use models\Hero; @@ -49,4 +48,24 @@ class MatchController extends BaseAuthedController { $this->_rspOk(); } + private function readTeamDb($r, $teamUuid) + { + $teamDbStr = $r->get(TEAMID_KEY . $teamUuid); + if (empty($teamDbStr)) { + return null; + } + $teamDb = json_decode($teamDbStr, true); + return $teamDb; + } + + private function readCurrMatchTeam($r) + { + $teamDbStr = $r->get(MATCH_CURRENT_TEAM_KEY . $teamUuid); + if (empty($teamDbStr)) { + return null; + } + $teamDb = json_decode($teamDbStr, true); + return $teamDb; + } + }