This commit is contained in:
aozhiwei 2021-12-08 19:31:11 +08:00
parent 948b811756
commit f608e1ffb5
2 changed files with 17 additions and 6 deletions

@ -1 +1 @@
Subproject commit 119990eeeac4281031895c17c9983b523699d757 Subproject commit 07323361e8abd576aa74a7fab9d2def0d7bee089

View File

@ -86,7 +86,7 @@ class SeasonCardController extends BaseAuthedController {
$type = getReqVal('type', 0); $type = getReqVal('type', 0);
$level = getReqVal('level', 0); $level = getReqVal('level', 0);
$cardMeta = mt\SeasonCard::get($level); $cardMeta = mt\SeasonCard::get($level);
if ($level) { if (!$level) {
$this->_rspErr(1, 'level参数错误'); $this->_rspErr(1, 'level参数错误');
return; return;
} }
@ -102,10 +102,19 @@ class SeasonCardController extends BaseAuthedController {
return; return;
} }
$cardDb = getXVal($this->seasonCardDb[$type], $level); $cardDb = getXVal($this->seasonCardDb[$type], $level);
if ($cardDd) { if ($cardDb) {
$this->_rspErr(3, '不能重复领取'); $this->_rspErr(3, '不能重复领取');
return; return;
} }
$dropMeta = mt\Drop::get($type == SeasonCard::NORMAL_PACKAGE_ID ? $cardMeta['reward'] : $cardMeta['advanced_reward']);
if (!$dropMeta){
$this->_rspErr(4, '配置表错误');
return;
}
$this->_scatterDrop('season:level_reward:' . $type . ':' . $level,
$dropMeta,
$this->awardService,
$this->propertyChgService);
SeasonCard::add($this->currSeasonMeta['id'], $type, $level); SeasonCard::add($this->currSeasonMeta['id'], $type, $level);
$this->_rspData(array( $this->_rspData(array(
'award' => $this->awardService->toDto(), 'award' => $this->awardService->toDto(),
@ -213,9 +222,11 @@ class SeasonCardController extends BaseAuthedController {
private function getReceivedLevelRewards($type) private function getReceivedLevelRewards($type)
{ {
return array_map(function ($val) { $levels = array();
return $val['card_lv']; foreach (getXVal($this->seasonCardDb, $type, array()) as $val) {
}, getXVal($this->seasonCardDb, $type, array())); array_push($levels, $val['card_lv']);
}
return $levels;
} }
} }