1
This commit is contained in:
parent
06d3f07634
commit
544b2d855c
@ -86,8 +86,7 @@ class MissionService extends BaseService {
|
||||
'refreshtime' => 0
|
||||
);
|
||||
}
|
||||
// print_r($this->offerRewartdMission);die;
|
||||
if (myself()->_getDaySeconds(myself()->_getNowTime()) - $this->offerRewartdMission['refreshtime'] >= 86400){
|
||||
if (myself()->_getNowTime() - $this->offerRewartdMission['refreshtime'] >= 86400){
|
||||
$this->refreshOfferRewardMission();
|
||||
}
|
||||
}
|
||||
@ -591,11 +590,11 @@ class MissionService extends BaseService {
|
||||
}
|
||||
$metas = mt\Task::getOfferRewardMissions
|
||||
($this->offerRewartdMission['missions']);
|
||||
if (count($metas) < $wantedRefreshMissionNum) {
|
||||
return;
|
||||
}
|
||||
|
||||
foreach (array_rand($metas, 5) as $key) {
|
||||
// if (count($metas) < $wantedRefreshMissionNum) {
|
||||
// return;
|
||||
// }
|
||||
$count = count($metas)>=5 ? 5 : count($metas);
|
||||
foreach (array_rand($metas, $count) as $key) {
|
||||
$meta = $metas[$key];
|
||||
if ($this->getMissionsCount() >=
|
||||
$wantedRefreshMissionNum) {
|
||||
@ -616,8 +615,6 @@ class MissionService extends BaseService {
|
||||
));
|
||||
}
|
||||
}
|
||||
// unset($this->offerRewartdMission['missions']);
|
||||
// print_r($this->offerRewartdMission['missions']);die;
|
||||
$this->offerRewartdMission['refreshtime'] = myself()->_getDaySeconds(myself()->_getNowTime());
|
||||
$this->saveOfferRewardMission();
|
||||
}
|
||||
@ -630,8 +627,6 @@ class MissionService extends BaseService {
|
||||
}
|
||||
}
|
||||
|
||||
// print_r(json_encode($this->offerRewartdMission));die;
|
||||
|
||||
// $metas = mt\Task::getOfferRewardMissions
|
||||
// ($this->offerRewartdMission['missions']);
|
||||
// $selectMeta = null;
|
||||
@ -680,6 +675,13 @@ class MissionService extends BaseService {
|
||||
}
|
||||
$missionDto['objects'] = $mission['objects'];
|
||||
$missionDto['ceg_num'] = $this->calcCegPreview($mission['objects']);
|
||||
$missionDto['awards'][0].= ':'.$this->calcCegPreview($mission['objects']);
|
||||
if (count($mission['objects']) > 0){
|
||||
$missionDto['awards'][1].=':'.'1' ;
|
||||
}else{
|
||||
$missionDto['awards'][1].=':'.'0' ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user