From 34d4b81ec6f3c7c5ab27975c2c4286f6af65ea94 Mon Sep 17 00:00:00 2001 From: hujiabin Date: Tue, 1 Nov 2022 16:28:32 +0800 Subject: [PATCH] 1 --- sql/gamedb.sql | 1 + webapp/models/Gun.php | 4 ++++ webapp/models/Hero.php | 4 ++++ webapp/models/User.php | 12 +++++++++++- webapp/models/UserSeasonRing.php | 5 ++++- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/sql/gamedb.sql b/sql/gamedb.sql index 0e22a411..04f14217 100644 --- a/sql/gamedb.sql +++ b/sql/gamedb.sql @@ -267,6 +267,7 @@ CREATE TABLE `t_chip` ( `lucky_final` varchar(10) NOT NULL DEFAULT '0' COMMENT '最终幸运值', `strength_max` varchar(10) NOT NULL DEFAULT '0' COMMENT '最大体力值', `strength` varchar(10) NOT NULL DEFAULT '0' COMMENT '前一天体力值', + `upgrade_mint` double NOT NULL DEFAULT '0' COMMENT 'mint费用', `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间', `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间', `labour` int(11) NOT NULL DEFAULT '0' COMMENT '劳力值', diff --git a/webapp/models/Gun.php b/webapp/models/Gun.php index e6f676c0..79877f65 100644 --- a/webapp/models/Gun.php +++ b/webapp/models/Gun.php @@ -130,6 +130,10 @@ class Gun extends BaseModel { if ($row) { $cb($row); } + }else{ + if ($row) { + $cb($row); + } } } } diff --git a/webapp/models/Hero.php b/webapp/models/Hero.php index 050e1568..d37d33b7 100644 --- a/webapp/models/Hero.php +++ b/webapp/models/Hero.php @@ -123,6 +123,10 @@ class Hero extends BaseModel { if ($row) { $cb($row); } + } else { + if ($row) { + $cb($row); + } } } } diff --git a/webapp/models/User.php b/webapp/models/User.php index a81c4750..46bd9a3d 100644 --- a/webapp/models/User.php +++ b/webapp/models/User.php @@ -211,6 +211,16 @@ class User extends BaseModel { } public static function getUserByRankMess($row){ + $currSeasonMeta = mt\RankSeason::getCurrentSeason(); + $gameTimes = 0; + if ($currSeasonMeta){ + $season = Season::find($currSeasonMeta['id']); + if ($season){ + $battleData = json_decode($season['battle_data'], true); + $seasonBattleData = isset($battleData) ? getXVal($battleData, 'season_data', array()) : array(); + $gameTimes = getXVal($seasonBattleData, 'total_battle_times', 0); + } + } $toDto =array( 'idx' => $row['idx'], 'account_id' => $row['account_id'], @@ -223,7 +233,7 @@ class User extends BaseModel { 'score' => $row['score'], 'history_best_score' => $row['history_best_score'], //排位场数 - 'rank_num' => 0, + 'rank_num' => $gameTimes, ); return $toDto; } diff --git a/webapp/models/UserSeasonRing.php b/webapp/models/UserSeasonRing.php index f5bf6faf..3444f6a9 100644 --- a/webapp/models/UserSeasonRing.php +++ b/webapp/models/UserSeasonRing.php @@ -63,8 +63,11 @@ class UserSeasonRing extends BaseModel if ($row) { $cb($row); } + }else{ + if ($row) { + $cb($row); + } } - } }