1
This commit is contained in:
parent
8d73921753
commit
b153ded396
@ -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;
|
||||
|
@ -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'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user