This commit is contained in:
hujiabin 2022-11-10 17:17:03 +08:00
parent 21ae31f785
commit 4b25fe4a47
2 changed files with 38 additions and 0 deletions

View File

@ -779,4 +779,23 @@ class GunController extends BaseAuthedController {
));
}
public function getLastQualityInfo(){
$tokenId = getReqVal('token_id', '');
if (!$tokenId){
$this->_rspErr(1, ' error param');
return;
}
$gunDb = Gun::findByTokenId2($tokenId);
if(!$gunDb || $gunDb['quality']<2){
$this->_rspErr(1, ' error param');
return;
}
$oldGunDb = $gunDb;
$oldGunDb['quality'] -= 1;
$this->_rspData(array(
'new_gun' =>Gun::toDto($gunDb),
'old_gun'=>Gun::toDto($oldGunDb)
));
}
}

View File

@ -915,4 +915,23 @@ class HeroController extends BaseAuthedController {
'old_hero'=>$oldHero
));
}
public function getLastQualityInfo(){
$tokenId = getReqVal('token_id', '');
if (!$tokenId){
$this->_rspErr(1, ' error param');
return;
}
$heroDb = Hero::findByTokenId2($tokenId);
if(!$heroDb || $heroDb['quality']<2){
$this->_rspErr(1, ' error param');
return;
}
$oldHeroDb = $heroDb;
$oldHeroDb['quality'] -= 1;
$this->_rspData(array(
'new_hero' =>Hero::toDto($heroDb),
'old_hero'=>Hero::toDto($oldHeroDb)
));
}
}