diff --git a/webapp/services/BattleBoxService.php b/webapp/services/BattleBoxService.php index eaf55b49..c659c5d7 100644 --- a/webapp/services/BattleBoxService.php +++ b/webapp/services/BattleBoxService.php @@ -237,4 +237,16 @@ class BattleBoxService { } } + public static function incDropTotalNum($phase, $time, $val) + { + $key = self::DAILY_PHASE_ALREADY_ALLOC_NUM_KEY . $phase . ':' . $time; + $r = myself()->_getRedis($key); + $num = intval($r->get($key)); + if (empty($num)) { + $r->setPx($key, $val, 1000 * 3600 * 24 * 7); + } else { + $r->setPx($key, $num + $val, 1000 * 3600 * 24 * 7); + } + } + } diff --git a/webapp/services/RoomBattleDataService.php b/webapp/services/RoomBattleDataService.php index df519a8a..b2e28232 100644 --- a/webapp/services/RoomBattleDataService.php +++ b/webapp/services/RoomBattleDataService.php @@ -18,6 +18,7 @@ require_once('mt/StakingVip.php'); require_once('services/AwardService.php'); require_once('services/PropertyChgService.php'); require_once('services/LogService.php'); +require_once('services/BattleBoxService.php'); require_once('phpcommon/tglog.php'); use models\Circuit; @@ -360,6 +361,20 @@ class RoomBattleDataService extends BaseService { } } if (count($rewardBox) > 0){ + if ($battleSingleDb) { + $row = SqlHelper::ormSelectOne( + myself()->_getSelfMysql(), + 't_box_alloc', + array( + 'room_uuid' => $battleSingleDb['room_uuid'], + ) + ); + if ($row) { + services\BattleBoxService::incDropTotalNum($row['phase'], + $row['createtime'], + $member['box_num']); + } + } $rewardBoxResult = myself()->_mergeAlikeItemKey($rewardBox); foreach ($rewardBoxResult as $item){ array_push($reward,$item);