|
@@ -35,16 +35,34 @@ class ActiveProc {
|
|
|
* 7日累充领奖
|
|
|
*/
|
|
|
public static function Day7__accumulateDrawreward() {
|
|
|
- list($typeId) = req()->paras; # 参数: 领取第x天的奖励
|
|
|
+ list($type,$typeId) = req()->paras; # 参数: 领取第x天的奖励
|
|
|
$user = ctx();
|
|
|
|
|
|
- my_Assert($user->privateState->day7_accumulate >= $typeId, ErrCode::active_day7_expired);
|
|
|
- my_Assert(!in_array($typeId, $user->privateState->day7_accumulateDrawed), ErrCode::active_hasgetted);
|
|
|
- $day_rwd = GameConfig::active_day7_accumulate_getItem($typeId); # 查询奖励数据
|
|
|
- my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
|
- StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
|
- $user->privateState->day7_accumulateDrawed[] = $typeId;
|
|
|
-
|
|
|
+ if($type == Enum_TaskType::Day7_Sign){
|
|
|
+ my_Assert($user->privateState->day7_accumulate >= $typeId, ErrCode::active_day7_expired);
|
|
|
+ my_Assert(!in_array($typeId, $user->privateState->day7_accumulateDrawed), ErrCode::active_hasgetted);
|
|
|
+ $day_rwd = GameConfig::active_day7_accumulate_getItem($typeId); # 查询奖励数据
|
|
|
+ my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
|
+ StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
|
+ $user->privateState->day7_accumulateDrawed[] = $typeId;
|
|
|
+
|
|
|
+
|
|
|
+ } elseif (Enum_TaskType::DailyTask) {
|
|
|
+ my_Assert($user->task->dailyTaskAccumulate >= $typeId, ErrCode::active_day7_expired);
|
|
|
+ my_Assert(!in_array($typeId, $user->task->dailyTaskAccumulateDrawed), ErrCode::active_hasgetted);
|
|
|
+ $day_rwd = GameConfig::task_accumulate_daily_getItem($typeId); # 查询奖励数据
|
|
|
+ my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
|
+ StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
|
+ $user->task->dailyTaskAccumulateDrawed[] = $typeId;
|
|
|
+ } elseif (Enum_TaskType::WeekTask) {
|
|
|
+ my_Assert($user->task->weekTaskAccumulate >= $typeId, ErrCode::active_day7_expired);
|
|
|
+ my_Assert(!in_array($typeId, $user->task->weekTaskAccumulateDrawed), ErrCode::active_hasgetted);
|
|
|
+ $day_rwd = GameConfig::task_accumulate_week_getItem($typeId); # 查询奖励数据
|
|
|
+ my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
|
+ StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
|
+ $user->task->weekTaskAccumulateDrawed[] = $typeId;
|
|
|
+ }
|
|
|
+
|
|
|
ctx($user);
|
|
|
UserProc::updateUserInfo(); # 回存
|
|
|
return Resp::ok(array(
|