From 2f9c065b24ee6b827b7e358b06e3ff4b47b3391a Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Tue, 8 Oct 2024 16:08:13 +0800 Subject: [PATCH] 1 --- webapp/services/BattleBoxService.php | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/webapp/services/BattleBoxService.php b/webapp/services/BattleBoxService.php index 09020de5..89bda969 100644 --- a/webapp/services/BattleBoxService.php +++ b/webapp/services/BattleBoxService.php @@ -88,28 +88,25 @@ class BattleBoxService { return empty($num) ? 0 : $num; } - private static function setDailyPhaseDropLastTime($phase, $time) + private static function setDailyPhaseDropLastTime($phase, $time, $val) { $key = self::DAILY_PHASE_DROP_LAST_TIME_KEY . $phase . ':' . $time; $r = $this->_getRedis($key); - $lastTime = $r->get($key); - return empty($lastTime) ? 0 : $lastTime; + $r->setPx($key, $val, 1000 * 3600 * 24 * 7); } private static function setDailyPhaseDropTotalNum($phase, $time) { $key = self::DAILY_PHASE_DROP_TOTAL_KEY . $phase . ':' . $time; $r = $this->_getRedis($key); - $num = $r->get($key); - return empty($num) ? 0 : $num; + $r->setPx($key, $val, 1000 * 3600 * 24 * 7); } private static function setDailyPhaseAllocNum($phase, $time) { $key = self::DAILY_PHASE_ALLOC_NUM_KEY . $phase . ':' . $time; $r = $this->_getRedis($key); - $num = $r->get($key); - return empty($num) ? 0 : $num; + $r->setPx($key, $val, 1000 * 3600 * 24 * 7); } private static function getDailyPhaseAlreadyAllocNum($phase, $time)