diff --git a/webapp/services/BattleDataService.php b/webapp/services/BattleDataService.php index b2d4508..573f0ed 100644 --- a/webapp/services/BattleDataService.php +++ b/webapp/services/BattleDataService.php @@ -2,70 +2,6 @@ namespace services; -/* - 数据结构: - { - "total_battle_times": 0, - "total_single_battle_times": 0, - "total_team_battle_times": 0, - "single_battle_rank": 0, - "team_battle_rank": 0, - "total_win_times": 0, - "total_kills_times": 0, - "max_kills_times": 0, - "total_damage_out":0, - "max_damage_out": 0, - "total_damage_in": 0, - "max_damage_in": 0, - "total_recover_hp": 0, - "max_recover_hp": 0, - "total_alive_time": 0, - "max_alive_time": 0, - "rescue_teammate_times": 0, - "diving_times": 0, - "open_airdrop_times": 0, - "use_medicine_times": 0, - "destory_car_times": 0, - "use_camouflage_times": 0, - "use_skill_times": 0, - "ride_car_move_distance": 0, - "ride_car_kills": 0, - "max_hero_skill_lv": 0, - "weapon_type_data": { - "${equip_type}_${equip_subtype}": - { - "kills": 1, - "damage_out": 1, - "obtain_count": 1, - } - }, - "weapon_slot_data": { - "${slot}": - { - "use_times": 1, - } - }, - "hero_data": { - "${hero_id}": - { - "skill_lv": 1, - "weapon_lv": 1, - } - }, - "createtime": 0, - "modifytime": 0, - } - 涉及的表: - t_battle.data - t_season.data - { - "daily_data": {}, - "weekly_data": { - 1: {} - } - } - */ - require_once('mt/Item.php'); require_once('mt/Equip.php'); require_once('mt/Season.php'); @@ -105,6 +41,12 @@ class BattleDataService extends BaseService { 'modifytime' => myself()->_getNowTime() ); } + if (!isset($seasonBattleData['season_data'])) { + $seasonBattleData['season_data'] = array( + 'createtime' => myself()->_getNowTime(), + 'modifytime' => myself()->_getNowTime() + ); + } if (!isset($seasonBattleData['his_week_data'])) { $seasonBattleData['his_week_data'] = array( ); @@ -129,6 +71,7 @@ class BattleDataService extends BaseService { 'modifytime' => myself()->_getNowTime() ); } + $this->apply($seasonBattleData['season_data']); $this->apply($seasonBattleData['today_data']); $this->apply($seasonBattleData['this_week_data']); } diff --git a/webapp/services/MissionService.php b/webapp/services/MissionService.php index 80a5db1..f6d24f2 100644 --- a/webapp/services/MissionService.php +++ b/webapp/services/MissionService.php @@ -17,8 +17,8 @@ class MissionService extends BaseService { private $seasonDb = null; private $hisBattleData = array(); private $seasonBattleData = array(); - private $weeklyBattleData = array(); - private $dailyBattleData = array(); + private $thisWeekBattleData = array(); + private $todayBattleData = array(); public function init($userInfo, $seasonDb) { @@ -380,7 +380,7 @@ class MissionService extends BaseService { if ($missionMeta['season_task'] == mt\Task::SEASON_MISSON_FLAG) { if ($missionMeta['type'] == mt\Task::SEASONCARD_MISSON_TYPE && $missionMeta['subtype'] == mt\Task::SEASON_WEAKLY_MISSON_SUBTYPE) { - $battleData = getXVal($this->weeklyBattleData, $missionMeta['week'], array()); + $battleData = $this->thisWeekBattleData; } else { $battleData = $this->seasonBattleData; }