From 6dd6e74b53cb47cd0f286a3ef7fcb45c879072ab Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 9 Oct 2024 10:40:37 +0800 Subject: [PATCH] 1 --- webapp/services/BattleBoxService.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/webapp/services/BattleBoxService.php b/webapp/services/BattleBoxService.php index 2cd9a6e5..af79aed9 100644 --- a/webapp/services/BattleBoxService.php +++ b/webapp/services/BattleBoxService.php @@ -6,6 +6,7 @@ require_once('mt/Parameter.php'); require_once('mt/MapMode.php'); use mt; +use phpcommon\SqlHelper; /* 1、周期还害没结束,箱子就掉完了 完成度=T max/T cost time(last time-start time) @@ -85,7 +86,7 @@ class BattleBoxService { $allocableNum = min(5000, $maxNum * $completionDegree); } if ($allocableNum) { - self::setDailyPhaseAllocNum($currPhase, $allocableNum); + self::setDailyPhaseAllocNum($currPhase, myself()->_getNowDaySeconds(), $allocableNum); } } if ($allocableNum > 0) { @@ -99,7 +100,7 @@ class BattleBoxService { } if ($boxNum > 0) { SqlHelper::insert( - $this->_getSelfMysql(), + myself()->_getSelfMysql(), 't_box_alloc', array( 'room_uuid' => $roomUuid, @@ -145,14 +146,14 @@ class BattleBoxService { $r->setPx($key, $val, 1000 * 3600 * 24 * 7); } - private static function setDailyPhaseDropTotalNum($phase, $time) + private static function setDailyPhaseDropTotalNum($phase, $time, $val) { $key = self::DAILY_PHASE_DROP_TOTAL_KEY . $phase . ':' . $time; $r = myself()->_getRedis($key); $r->setPx($key, $val, 1000 * 3600 * 24 * 7); } - private static function setDailyPhaseAllocNum($phase, $time) + private static function setDailyPhaseAllocNum($phase, $time, $val) { $key = self::DAILY_PHASE_ALLOC_NUM_KEY . $phase . ':' . $time; $r = myself()->_getRedis($key);