This commit is contained in:
hujiabin 2024-02-26 16:57:01 +08:00
parent 07eacbc353
commit b8d4ea7e1b
4 changed files with 44 additions and 2 deletions

View File

@ -1073,7 +1073,7 @@ CREATE TABLE `t_rank_battle` (
`channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel', `channel` int(11) NOT NULL DEFAULT '0' COMMENT 'channel',
`mode` int(11) NOT NULL DEFAULT '0' COMMENT '1:4v4 2pvp', `mode` int(11) NOT NULL DEFAULT '0' COMMENT '1:4v4 2pvp',
`class` int(11) NOT NULL DEFAULT '0' COMMENT '1:总榜 2日榜 3周榜', `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', `value` bigint NOT NULL DEFAULT '0' COMMENT 'value',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',

View File

@ -720,7 +720,7 @@ class BattleController extends BaseAuthedController {
// $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc'); // $historyList = BattleHistory::orderBy(BattleHistory::getMyBattleHistoryByMode($mode),'desc');
$data = array(); $data = array();
foreach ($historyList as $k=>$history){ foreach ($historyList as $k=>$history){
if ($k < 20){ if ($k < 40){
array_push($data,BattleHistory::toDto($history)); array_push($data,BattleHistory::toDto($history));
} }
} }

View File

@ -13,6 +13,11 @@ class RankBattle extends BaseModel
const MVP_TIMES = 3; const MVP_TIMES = 3;
const TOP_THREE_TIMES = 4; const TOP_THREE_TIMES = 4;
const KILL_TIMES = 5; 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 OVERALL_CHARTS = 1;
const DAILY_CHARTS = 2; const DAILY_CHARTS = 2;

View File

@ -188,6 +188,31 @@ class TameBattleDataService extends BaseService {
if (getXVal($this->battleInfo,'pvp_kill', 0) > 0){ if (getXVal($this->battleInfo,'pvp_kill', 0) > 0){
RankBattle::upsert($account,RankBattle::PVP_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'pvp_kill', 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; break;
case self::ROOM_MODE_MOBA : { case self::ROOM_MODE_MOBA : {
@ -203,6 +228,18 @@ class TameBattleDataService extends BaseService {
if (getXVal($this->battleInfo,'kills', 0) > 0){ if (getXVal($this->battleInfo,'kills', 0) > 0){
RankBattle::upsert($account,RankBattle::MOBA_DATA,RankBattle::KILL_TIMES,getXVal($this->battleInfo,'kills', 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));
}
} }
} }