|
@@ -19,7 +19,7 @@ class PetDataDto
|
|
|
public static function toDataPet(\App\Module\Pet\Dtos\PetDataDto $petDataDto): DataPet
|
|
public static function toDataPet(\App\Module\Pet\Dtos\PetDataDto $petDataDto): DataPet
|
|
|
{
|
|
{
|
|
|
$dataPet = new DataPet();
|
|
$dataPet = new DataPet();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 设置基本宠物信息
|
|
// 设置基本宠物信息
|
|
|
$dataPet->setId($petDataDto->id);
|
|
$dataPet->setId($petDataDto->id);
|
|
|
$dataPet->setTypeId($petDataDto->typeId);
|
|
$dataPet->setTypeId($petDataDto->typeId);
|
|
@@ -32,13 +32,13 @@ class PetDataDto
|
|
|
$dataPet->setFightingCapacity($petDataDto->fightingCapacity);
|
|
$dataPet->setFightingCapacity($petDataDto->fightingCapacity);
|
|
|
$dataPet->setGrade($petDataDto->grade);
|
|
$dataPet->setGrade($petDataDto->grade);
|
|
|
$dataPet->setStatus($petDataDto->status);
|
|
$dataPet->setStatus($petDataDto->status);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
// 设置生活技能
|
|
// 设置生活技能
|
|
|
if (!empty($petDataDto->lifeSkills)) {
|
|
if (!empty($petDataDto->lifeSkills)) {
|
|
|
$lifeSkills = [];
|
|
$lifeSkills = [];
|
|
|
foreach ($petDataDto->lifeSkills as $skill) {
|
|
foreach ($petDataDto->lifeSkills as $skill) {
|
|
|
$petLifeSkill = new PetLifeSkill();
|
|
$petLifeSkill = new PetLifeSkill();
|
|
|
- $petLifeSkill->setPetId($petDataDto->id);
|
|
|
|
|
|
|
+
|
|
|
$petLifeSkill->setSkillId($skill->skillId ?? 0);
|
|
$petLifeSkill->setSkillId($skill->skillId ?? 0);
|
|
|
$petLifeSkill->setCanuse($skill->canUse ?? false);
|
|
$petLifeSkill->setCanuse($skill->canUse ?? false);
|
|
|
$petLifeSkill->setCurnum($skill->currentCooldown ?? 0);
|
|
$petLifeSkill->setCurnum($skill->currentCooldown ?? 0);
|
|
@@ -47,7 +47,7 @@ class PetDataDto
|
|
|
}
|
|
}
|
|
|
$dataPet->setLifeSkills($lifeSkills);
|
|
$dataPet->setLifeSkills($lifeSkills);
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
return $dataPet;
|
|
return $dataPet;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|