diff --git a/webapp/services/BattleBoxService.php b/webapp/services/BattleBoxService.php index 2c54974b..4264bc29 100644 --- a/webapp/services/BattleBoxService.php +++ b/webapp/services/BattleBoxService.php @@ -29,6 +29,19 @@ class BattleBoxService { } } } + if ($boxNum > 0) { + SqlHelper::insert( + $this->_getSelfMysql(), + 't_box_alloc', + array( + 'room_uuid' => $roomUuid, + 'account_id' => myself()->_getAccountId(), + 'box_num' => $boxNum, + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime(), + ) + ); + } return $boxNum; } @@ -69,9 +82,9 @@ class BattleBoxService { return empty($num) ? 0 : $num; } - private static function incAlreadyTodayAllocBoxNum($val) + private static function incAlreadyAllocNum($phase, $time, $val) { - $key = 'box_daily_already_alloc_num:' . myself()->_getNowDaySeconds(); + $key = self::DAILY_PHASE_ALREADY_ALLOC_NUM_KEY . $phase . ':' . $time; $r = $this->_getRedis($key); $num = intval($r->get($key)); if (empty($num)) {