This commit is contained in:
hujiabin 2023-03-07 15:02:15 +08:00
parent 1bc8f8e2f0
commit 73bcb52c17

View File

@ -282,17 +282,30 @@ class HeroController extends BaseAuthedController {
)
);
if ($row){
$data = array(
'skill_id' => $row['skill_id'],
'weapon_uid1' => $row['weapon_uid1'],
'weapon_uid2' => $row['weapon_uid2'],
'chip_page' => $row['chip_page'],
'gun_id1'=>0,
'gun_id2'=>0,
);
$gunDb1 = Gun::find($row['weapon_uid1']);
$gunDb2 = Gun::find($row['weapon_uid2']);
if ($gunDb1){
$data['gun_id1'] = $gunDb1['gun_id'];
}
if ($gunDb1){
$data['gun_id2'] = $gunDb2['gun_id'];
}
}else{
$data = array(
'skill_id' => \mt\Skill::DEFAULT_SKILL,
'weapon_uid1' => 0,
'weapon_uid2' => 0,
'gun_id1'=>0,
'gun_id2'=>0,
'chip_page' => 1,
);
}