From 21587f7c372f36a06bbbe194bbed2246b625c569 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 26 Dec 2023 15:01:16 +0800 Subject: [PATCH] 1 --- webapp/controller/MatchController.class.php | 23 +++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/webapp/controller/MatchController.class.php b/webapp/controller/MatchController.class.php index 80670b03..28644d17 100644 --- a/webapp/controller/MatchController.class.php +++ b/webapp/controller/MatchController.class.php @@ -36,6 +36,7 @@ class MatchController extends BaseAuthedController { if ($matchOkDb) { $this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600); $this->refreshKeyExpire($r, MATCH_OK_KEY . $matchOkDb['target_team'], 1000*600); + $this->refreshKeyExpire($r, TEAMID_KEY . $matchOkDb['target_team'], 1000*600); } else { $currMatchDb = $this->readCurrMatchTeam($r); if (empty($currMatchDb)) { @@ -72,7 +73,7 @@ class MatchController extends BaseAuthedController { if (empty($teamDbStr)) { return null; } - $r->refreshKeyExpire($r, TEAMID_KEY . $teamUuid, 1000*600); + $this->refreshKeyExpire($r, TEAMID_KEY . $teamUuid, 1000*600); $teamDb = json_decode($teamDbStr, true); return $teamDb; } @@ -117,7 +118,25 @@ class MatchController extends BaseAuthedController { private function matchOk($r, $teamUuid, $currMatchDb) { - + { + $r->del(MATCH_CURRENT_TEAM_KEY); + } + { + $matchOkDb = array( + 'target_team' => $currMatchDb['current_team'], + 'match_time' => $this->_getNowTime() + ); + $r->set(MATCH_OK_KEY . $teamUuid, json_encode($currMatchDb)); + $this->refreshKeyExpire($r, MATCH_OK_KEY . $teamUuid, 1000*600); + } + { + $matchOkDb = array( + 'target_team' => $teamUuid, + 'match_time' => $this->_getNowTime() + ); + $r->set(MATCH_OK_KEY . $currMatchDb['current_team'], json_encode($currMatchDb)); + $this->refreshKeyExpire($r, MATCH_OK_KEY . $currMatchDb['current_team'], 1000*600); + } } }