1
This commit is contained in:
parent
8c67ec43ee
commit
4b5eb1d239
@ -22,6 +22,7 @@ use models\Season;
|
|||||||
|
|
||||||
class MissionController extends BaseAuthedController {
|
class MissionController extends BaseAuthedController {
|
||||||
|
|
||||||
|
private $missionService = null;
|
||||||
private $propertyChgService = null;
|
private $propertyChgService = null;
|
||||||
private $userInfo = null;
|
private $userInfo = null;
|
||||||
private $seasonService = null;
|
private $seasonService = null;
|
||||||
@ -53,6 +54,7 @@ class MissionController extends BaseAuthedController {
|
|||||||
$this->_rspErr(10, '服务器内部错误');
|
$this->_rspErr(10, '服务器内部错误');
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
$this->missionService = new services\MissionService();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function missionList()
|
public function missionList()
|
||||||
@ -63,7 +65,8 @@ class MissionController extends BaseAuthedController {
|
|||||||
$missionDtoList = array();
|
$missionDtoList = array();
|
||||||
foreach ($missionMetaList as $missionMeta) {
|
foreach ($missionMetaList as $missionMeta) {
|
||||||
$missionDb = getXVal($missionHash, $missionMeta['id'], null);
|
$missionDb = getXVal($missionHash, $missionMeta['id'], null);
|
||||||
$missionDto = $this->getMissionDto($this->userInfo, $this->seasonDb, $missionDb, $missionMeta);
|
$missionDto = $this->missionService->getMissionDto(
|
||||||
|
$this->userInfo, $this->seasonDb, $missionDb, $missionMeta);
|
||||||
array_push($missionDtoList, $missionDto);
|
array_push($missionDtoList, $missionDto);
|
||||||
}
|
}
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
@ -80,7 +83,8 @@ class MissionController extends BaseAuthedController {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$missionDb = Mission::find($missionId);
|
$missionDb = Mission::find($missionId);
|
||||||
$missionDto = $this->getMissionDto($this->userInfo, $this->seasonDb, $missionDb, $missionMeta);
|
$missionDto = $this->missionService->getMissionDto(
|
||||||
|
$this->userInfo, $this->seasonDb, $missionDb, $missionMeta);
|
||||||
if (!$missionDto) {
|
if (!$missionDto) {
|
||||||
$this->_rspErr(10, '服务器内部错误');
|
$this->_rspErr(10, '服务器内部错误');
|
||||||
return;
|
return;
|
||||||
@ -105,7 +109,7 @@ class MissionController extends BaseAuthedController {
|
|||||||
$this->_scatterDrop($dropMeta, $this->awardService, $this->propertyChgService);
|
$this->_scatterDrop($dropMeta, $this->awardService, $this->propertyChgService);
|
||||||
Mission::add($missionId);
|
Mission::add($missionId);
|
||||||
$missionDb = Mission::find($missionId);
|
$missionDb = Mission::find($missionId);
|
||||||
$missionDto = $this->getMissionDto($missionDb, $missionMeta);
|
$missionDto = $this->missionService->getMissionDto($missionDb, $missionMeta);
|
||||||
$this->_rspData(array(
|
$this->_rspData(array(
|
||||||
'award' => $this->awardService->toDto(),
|
'award' => $this->awardService->toDto(),
|
||||||
'property_chg' => $this->propertyChgService->toDto(),
|
'property_chg' => $this->propertyChgService->toDto(),
|
||||||
@ -121,7 +125,8 @@ class MissionController extends BaseAuthedController {
|
|||||||
$missionDtoList = array();
|
$missionDtoList = array();
|
||||||
foreach ($missionMetaList as $missionMeta) {
|
foreach ($missionMetaList as $missionMeta) {
|
||||||
$missionDb = getXVal($missionHash, $missionMeta['id'], null);
|
$missionDb = getXVal($missionHash, $missionMeta['id'], null);
|
||||||
$missionDto = $this->getMissionDto($this->userInfo, $this->seasonDb, $missionDb, $missionMeta);
|
$missionDto = $this->missionService->getMissionDto(
|
||||||
|
$this->userInfo, $this->seasonDb, $missionDb, $missionMeta);
|
||||||
if ($missionDto['state'] == Mission::RECEIVEABLE_STATE) {
|
if ($missionDto['state'] == Mission::RECEIVEABLE_STATE) {
|
||||||
array_push($missionDtoList, $missionDto);
|
array_push($missionDtoList, $missionDto);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user