1
This commit is contained in:
parent
4f62a662b7
commit
6402edda17
@ -614,8 +614,9 @@ class MissionService extends BaseService {
|
|||||||
myself()->_rspErr(1, 'mission_id parameter error');
|
myself()->_rspErr(1, 'mission_id parameter error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
$idx = 0;
|
||||||
$mission = null;
|
$mission = null;
|
||||||
if (!$this->getOfferRewardMissionById($missionId, $mission)) {
|
if (!$this->getOfferRewardMissionById($missionId, $mission, $idx)) {
|
||||||
myself()->_rspErr(1, 'mission_id parameter error');
|
myself()->_rspErr(1, 'mission_id parameter error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -634,6 +635,9 @@ class MissionService extends BaseService {
|
|||||||
$objects = explode('|', getReqVal('objects', 0));
|
$objects = explode('|', getReqVal('objects', 0));
|
||||||
foreach ($objects as $val) {
|
foreach ($objects as $val) {
|
||||||
$strings = explode(':', $val);
|
$strings = explode(':', $val);
|
||||||
|
if (count($strings) < 2) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$type = $strings[0];
|
$type = $strings[0];
|
||||||
$id = $strings[1];
|
$id = $strings[1];
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
@ -671,6 +675,7 @@ class MissionService extends BaseService {
|
|||||||
error_log(111);
|
error_log(111);
|
||||||
$mission['sendtime'] = myself()->_getNowTime();
|
$mission['sendtime'] = myself()->_getNowTime();
|
||||||
error_log(json_encode($mission));
|
error_log(json_encode($mission));
|
||||||
|
$this->offerRewartdMission['missions'][$idx] = $mission;
|
||||||
$this->saveOfferRewardMission();
|
$this->saveOfferRewardMission();
|
||||||
error_log(json_encode($this->offerRewartdMission));
|
error_log(json_encode($this->offerRewartdMission));
|
||||||
myself()->_rspOk();
|
myself()->_rspOk();
|
||||||
@ -678,8 +683,9 @@ class MissionService extends BaseService {
|
|||||||
|
|
||||||
public function boostOfferRewardMission($missionId)
|
public function boostOfferRewardMission($missionId)
|
||||||
{
|
{
|
||||||
|
$idx = 0;
|
||||||
$mission = null;
|
$mission = null;
|
||||||
if (!$this->getOfferRewardMissionById($missionId, $mission)) {
|
if (!$this->getOfferRewardMissionById($missionId, $mission, $idx)) {
|
||||||
myself()->_rspErr(1, 'mission_id parameter error');
|
myself()->_rspErr(1, 'mission_id parameter error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -707,14 +713,16 @@ class MissionService extends BaseService {
|
|||||||
myself()->_rspOk();
|
myself()->_rspOk();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getOfferRewardMissionById($missionId, &$mission)
|
private function getOfferRewardMissionById($missionId, &$mission, &$idx)
|
||||||
{
|
{
|
||||||
|
$idx = 0;
|
||||||
$missions = &$this->getOfferRewardMissions();
|
$missions = &$this->getOfferRewardMissions();
|
||||||
foreach ($missions as &$val) {
|
foreach ($missions as &$val) {
|
||||||
if ($val['mission_id'] == $missionId) {
|
if ($val['mission_id'] == $missionId) {
|
||||||
$mission = $val;
|
$mission = $val;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
++$idx;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user