This commit is contained in:
aozhiwei 2022-06-06 17:06:03 +08:00
parent 8d73921753
commit b153ded396
2 changed files with 39 additions and 0 deletions

View File

@ -316,6 +316,12 @@ class MissionController extends BaseAuthedController {
if ($gunDb) {
$gunDto = Gun::toDto($gunDb);
$totalGunUpLimit += $gunDto['raw_pve_ceg_uplimit'];
Gun::Update
($obj['id'],
array(
'lock_type' => 0,
'unlock_time' => 0
));
}
}
break;
@ -326,6 +332,12 @@ class MissionController extends BaseAuthedController {
if ($heroDb) {
$heroDto = Hero::toDto($heroDb);
$totalHeroUpLimit += $heroDto['raw_pve_ceg_uplimit'];
Hero::Update
($obj['id'],
array(
'lock_type' => 0,
'unlock_time' => 0
));
}
}
break;

View File

@ -585,6 +585,33 @@ class MissionService extends BaseService {
$this->saveOfferRewardMission();
}
public function updateOfferRewardMission($missionId)
{
$metas = mt\Task::getOfferRewardMissions
($this->offerRewartdMission['missions']);
$selectMeta = null;
foreach (array_rand($metas, count($metas)) as $key) {
$meta = $metas[$key];
if (!$this->inOfferRewardMission($meta['id'])) {
$selectMeta = $meta;
break;
}
}
if ($selectMeta) {
foreach ($this->offerRewartdMission['missions'] as &$mission) {
if ($mission['mission_id'] == $missionId) {
$mission['mission_id'] = $selectMeta['id'];
$mission['createtime'] = myself()->_getNowTime();
$mission['modifytime'] = myself()->_getNowTime();
$mission['sendtime'] = 0;
$mission['objects'] = array();
break;
}
}
}
}
public function &getOfferRewardMissions()
{
return $this->offerRewartdMission['missions'];