This commit is contained in:
hujiabin 2023-03-30 20:17:57 +08:00
parent 41cf561327
commit e1ce023900

View File

@ -59,13 +59,13 @@ class BattleHistory extends BaseModel
public static function toDto($row){ public static function toDto($row){
if ($row['hero_id']){ if ($row['hero_id']){
$row['hero_id'] = Hero::find($row['hero_id'])['hero_id']; $row['hero_id'] = Hero::findByAccountId($row['account_id'],$row['hero_id'])['hero_id'];
} }
if ($row['weapon1']){ if ($row['weapon1']){
$row['weapon1'] = Gun::find($row['weapon1'])['gun_id']; $row['weapon1'] = Gun::findByAccountId($row['account_id'],$row['weapon1'])['gun_id'];
} }
if ($row['weapon2']){ if ($row['weapon2']){
$row['weapon2'] = Gun::find($row['weapon2'])['gun_id']; $row['weapon2'] = Gun::findByAccountId($row['account_id'],$row['weapon2'])['gun_id'];
} }
return $row; return $row;
} }