1
This commit is contained in:
parent
041eb4f995
commit
3e7603067d
@ -73,11 +73,28 @@ class SeasonController extends BaseAuthedController {
|
||||
public function getMissionReward()
|
||||
{
|
||||
$mission = $this->getMissionInfo();
|
||||
if ($mission['state'] != Mission::RECEIVEABLE_STATE) {
|
||||
if (!$mission || $mission['state'] != Mission::RECEIVEABLE_STATE) {
|
||||
$this->_rspErr(1, '不可领取');
|
||||
return;
|
||||
}
|
||||
$this->_rspOk();
|
||||
$missionMeta = mt\Task::get($this->currSeasonMeta['task_id']);
|
||||
if (!$missionMeta) {
|
||||
$this->_rspErr(10, '服务器内部错误drop错误');
|
||||
return;
|
||||
}
|
||||
$dropMeta = mt\Drop::get($missionMeta['reward']);
|
||||
if (!$dropMeta) {
|
||||
$this->_rspErr(10, '服务器内部错误drop错误');
|
||||
return;
|
||||
}
|
||||
$this->_scatterDrop($dropMeta, $this->awardService, $this->propertyChgService);
|
||||
Mission::add($missionId);
|
||||
$missionDb = Mission::find($missionId);
|
||||
$missionDto = $this->missionService->getMissionDto($missionDb, $missionMeta);
|
||||
$this->_rspData(array(
|
||||
'award' => $this->awardService->toDto(),
|
||||
'property_chg' => $this->propertyChgService->toDto(),
|
||||
));
|
||||
}
|
||||
|
||||
private function getMissionInfo()
|
||||
|
Loading…
x
Reference in New Issue
Block a user