diff --git a/sql/gamedb.sql b/sql/gamedb.sql index b0f2ee77..3c41d4ca 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -1073,7 +1073,7 @@ CREATE TABLE `t_rank_battle` ( `channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel', `mode` int(11) NOT NULL DEFAULT '0' COMMENT '1:4v4 2:pvp', `class` int(11) NOT NULL DEFAULT '0' COMMENT '1:总榜 2:日榜 3:周榜', - `type` int(11) NOT NULL DEFAULT '0' COMMENT 'type 1:场次榜 2:吃鸡榜 3:mvp榜 4:前三名榜 5:击杀榜', + `type` int(11) NOT NULL DEFAULT '0' COMMENT 'type 1:场次榜 2:吃鸡榜 3:mvp榜 4:前三名榜 5:击杀榜 6:伤害 7:助攻 8:治疗量 9:存活时间 10:救援数', `value` bigint NOT NULL DEFAULT '0' COMMENT 'value', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', diff --git a/webapp/controller/BattleController.class.php b/webapp/controller/BattleController.class.php index 2ebb7784..f1f55459 100644 --- a/webapp/controller/BattleController.class.php +++ b/webapp/controller/BattleController.class.php @@ -720,7 +720,7 @@ class BattleController extends BaseAuthedController { // $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc'); $data = array(); foreach ($historyList as $k=>$history){ - if ($k < 20){ + if ($k < 40){ array_push($data,BattleHistory::toDto($history)); } } diff --git a/webapp/models/RankBattle.php b/webapp/models/RankBattle.php index 41224886..4675549b 100644 --- a/webapp/models/RankBattle.php +++ b/webapp/models/RankBattle.php @@ -13,6 +13,11 @@ class RankBattle extends BaseModel const MVP_TIMES = 3; const TOP_THREE_TIMES = 4; const KILL_TIMES = 5; + const DAMAGES_OUT = 6; + const ASSIST_TIMES = 7; + const RECOVER_HP = 8; + const SURVIVAL_TIME = 9; + const RESCUE_TIMES = 10; const OVERALL_CHARTS = 1; const DAILY_CHARTS = 2; diff --git a/webapp/services/TameBattleDataService.php b/webapp/services/TameBattleDataService.php index 90d6afb9..3c458a8c 100644 --- a/webapp/services/TameBattleDataService.php +++ b/webapp/services/TameBattleDataService.php @@ -188,6 +188,31 @@ class TameBattleDataService extends BaseService { if (getXVal($this->battleInfo,'pvp_kill', 0) > 0){ RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'pvp_kill', 0)); } + + //伤害 + if (getXVal($this->battleInfo,'pvp_damage', 0) > 0){ + RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::DAMAGES_OUT,getXVal($this->battleInfo,'pvp_damage', 0)); + } + + //助攻 + if (getXVal($this->battleInfo,'pvp_assist', 0) > 0){ + RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::ASSIST_TIMES,getXVal($this->battleInfo,'pvp_assist', 0)); + } + + //治疗 + if (getXVal($this->battleInfo,'pvp_recover', 0) > 0){ + RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::RECOVER_HP,getXVal($this->battleInfo,'pvp_recover', 0)); + } + + //存活时间 + if (getXVal($this->battleInfo,'pvp_survia_time', 0)/1000 >= 1 ){ + RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::SURVIVAL_TIME,round(getXVal($this->battleInfo,'pvp_survia_time', 0)/1000)); + } + + //救援数 + if (getXVal($this->battleInfo,'pvp_rescue', 0) > 0){ + RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::RESCUE_TIMES,getXVal($this->battleInfo,'pvp_rescue', 0)); + } } break; case self::ROOM_MODE_MOBA : { @@ -203,6 +228,18 @@ class TameBattleDataService extends BaseService { if (getXVal($this->battleInfo,'kills', 0) > 0){ RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'kills', 0)); } + //伤害 + if (getXVal($this->battleInfo,'damage_out', 0) > 0){ + RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::DAMAGES_OUT,getXVal($this->battleInfo,'damage_out', 0)); + } + //助攻 + if (getXVal($this->battleInfo,'assist', 0) > 0){ + RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::ASSIST_TIMES,getXVal($this->battleInfo,'assist', 0)); + } + //治疗 + if (getXVal($this->battleInfo,'recover_hp', 0) > 0){ + RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::RECOVER_HP,getXVal($this->battleInfo,'recover_hp', 0)); + } } }