This commit is contained in:
aozhiwei 2022-06-14 18:50:14 +08:00
parent c8c98d9d90
commit 0f104c0b37

View File

@ -393,6 +393,10 @@ class HeroController extends BaseAuthedController {
$this->_rspErr(1, 'cost hero parameter error');
return;
}
if ($costHeroDb['lock_type']) {
$this->_rspErr(2, 'Cannot operate during locking');
return;
}
{
$srcHeroDb = Hero::find($this->_getV(TN_HERO_QUALITY_UP, $slotId));
if ($srcHeroDb) {
@ -428,7 +432,7 @@ class HeroController extends BaseAuthedController {
$this->_rspErr(3, 'Trial hero cannot operate');
return;
}
if ($heroDb['unlock_time'] > $this->_getNowTime()) {
if ($heroDb['lock_type']) {
$this->_rspErr(2, 'Cannot operate during locking');
return;
}
@ -497,7 +501,14 @@ class HeroController extends BaseAuthedController {
'unlock_time' => $this->_getNowTime() + $nextQualityMeta['time'],
)
);
Hero::update($costHeroUniId,
array(
'lock_type' => Hero::COST_LOCK,
'unlock_time' => $this->_getNowTime() + $nextQualityMeta['time'],
)
);
$this->_setV(TN_HERO_QUALITY_UP, (int)$slotId, (int)$heroDb['idx']);
$this->_setV(TN_HERO_QUALITY_UP, (int)$slotId * 100, (int)$costHeroDb['idx']);
$propertyChgService = new services\PropertyChgService();
$propertyChgService->addHeroChg();
$propertyChgService->addBagChg();