This commit is contained in:
hujiabin 2022-11-02 14:28:39 +08:00
parent a5f1bad99b
commit a83b753f83
2 changed files with 14 additions and 1 deletions

View File

@ -22,6 +22,19 @@ class Season extends BaseModel {
return $row;
}
public static function findByAccount($accountId,$seasonId)
{
$row = SqlHelper::ormSelectOne(
myself()->_getSelfMysql(),
't_season',
array(
'account_id' => $accountId,
'season_id' => $seasonId,
)
);
return $row;
}
public static function toDto($row)
{
return array(

View File

@ -214,7 +214,7 @@ class User extends BaseModel {
$currSeasonMeta = mt\RankSeason::getCurrentSeason();
$gameTimes = 0;
if ($currSeasonMeta){
$season = Season::find($currSeasonMeta['id']);
$season = Season::findByAccount($row['account_id'],$currSeasonMeta['id']);
if ($season){
$battleData = json_decode($season['battle_data'], true);
$seasonBattleData = isset($battleData) ? getXVal($battleData, 'season_data', array()) : array();