This commit is contained in:
aozhiwei 2022-09-18 09:45:36 +08:00
parent daf9fdb349
commit a564c68236

View File

@ -36,14 +36,17 @@ use services\FormulaService;
class BattleDataService extends BaseService {
private $seasonDb = array();
private $heroDto = null;
private $heroMeta = null;
private $weapon1Dto = null;
private $weapon2Dto = null;
private $reward = array(
'hero' => array(),
'weapon1' => array(),
'weapon2' => array(),
'items' => array()
);
private $heroDto = null;
private $heroMeta = null;
private $rankActivityService = null;
private $pveGeminiMeta = null;
private $pveGeminiModeMeta = null;
@ -56,19 +59,41 @@ class BattleDataService extends BaseService {
public function updateBattleData()
{
$row = Hero::find(getReqVal('hero_uniid', 0));
if (!$row) {
error_log(json_encode($_REQUEST));
{
$heroDb = Hero::find(getReqVal('hero_uniid', 0));
if (!$heroDb) {
return false;
}
$this->heroDto = Hero::toDto($row);
$this->heroDto = Hero::toDto($heroDb);
if (Hero::heroIsLocking($heroDb)) {
return false;
}
error_log(json_encode($_REQUEST));
$this->heroMeta = mt\Hero::get($this->heroDto['hero_id']);
if (!$this->heroMeta) {
return false;
}
}
{
$weaponUuid1 = getReqVal('weapon_uuid1', '');
if ($weaponUuid1) {
$weaponDb = Gun::find($weaponUuid1);
if (!$weaponDb) {
return false;
}
$this->weapon1Dto = Gun::toDto($weaponDb);
}
}
{
$weaponUuid2 = getReqVal('weapon_uuid2', '');
if ($weaponUuid2) {
$weaponDb = Gun::find($weaponUuid2);
if (!$weaponDb) {
return false;
}
$this->weapon2Dto = Gun::toDto($weaponDb);
}
}
$matchMode = getReqVal('match_mode');
switch ($matchMode) {
case 0: