From aa675b886fc44312e722ca9810606d95077236e6 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 8 Dec 2021 10:31:48 +0800 Subject: [PATCH] 1 --- webapp/controller/MissionController.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/webapp/controller/MissionController.class.php b/webapp/controller/MissionController.class.php index d786c40..7811164 100644 --- a/webapp/controller/MissionController.class.php +++ b/webapp/controller/MissionController.class.php @@ -118,6 +118,23 @@ class MissionController extends BaseAuthedController { public function commitAll() { + $type = getReqVal('type', 0); + $missionMetaList = mt\Task::getCustomTypeMetaList($type); + $missionHash = Mission::allToHash(); + $missionDtoList = array(); + foreach ($missionMetaList as $missionMeta) { + $missionDb = getXVal($missionHash, $missionMeta['id'], null); + $missionDto = $this->getMissionDto($this->userInfo, $this->seasonDb, $missionDb, $missionMeta); + array_push($missionDtoList, $missionDto); + } + $propertyChgService = new services\PropertyChgService(); + $awardService = new services\AwardService(); + $this->_scatterDrop($dropMeta, $awardService, $propertyChgService); + Mission::add($missionId); + $this->_rspData(array( + 'award' => $awardService->toDto(), + 'property_chg' => $propertyChgService->toDto(), + )); } }