1
This commit is contained in:
parent
4514407efc
commit
8d73921753
@ -565,13 +565,12 @@ class MissionService extends BaseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach (array_rand($metas, count($metas)) as $key) {
|
foreach (array_rand($metas, count($metas)) as $key) {
|
||||||
|
$meta = $metas[$key];
|
||||||
if (count($this->offerRewartdMission['missions']) >=
|
if (count($this->offerRewartdMission['missions']) >=
|
||||||
$wantedRefreshMissionNum) {
|
$wantedRefreshMissionNum) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$meta = $metas[$key];
|
if (!$this->inOfferRewardMission($meta['id'])) {
|
||||||
$found = false;
|
|
||||||
if (!$found) {
|
|
||||||
array_push($this->offerRewartdMission['missions'],
|
array_push($this->offerRewartdMission['missions'],
|
||||||
array(
|
array(
|
||||||
'mission_id' => $meta['id'],
|
'mission_id' => $meta['id'],
|
||||||
@ -876,4 +875,14 @@ class MissionService extends BaseService {
|
|||||||
return count($missions);
|
return count($missions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function inOfferRewardMission($missionId)
|
||||||
|
{
|
||||||
|
foreach ($this->offerRewartdMission['missions'] as $mission) {
|
||||||
|
if ($mission['mission_id'] == $missionId) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user