|
@@ -23,17 +23,45 @@ class ActiveProc {
|
|
|
switch ($req->cmd) {
|
|
|
case CmdCode::active_day7_drawreward: # 6101 签到
|
|
|
return ActiveProc::Day7_DrawReward();
|
|
|
+ case CmdCode::active_day7_accumulateDrawreward: # 6102 7日累充
|
|
|
+ return ActiveProc::Day7__accumulateDrawreward();
|
|
|
+
|
|
|
default:
|
|
|
Err(ErrCode::cmd_err);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 7日累充领奖
|
|
|
+ */
|
|
|
+ public static function Day7__accumulateDrawreward() {
|
|
|
+ list($typeId) = req()->paras; # 参数: 领取第x天的奖励
|
|
|
+ $user = ctx();
|
|
|
+
|
|
|
+ my_Assert($user->privateState->day7_accumulate >= $typeId, ErrCode::active_day7_expired);
|
|
|
+ my_Assert(!in_array($day, $user->privateState->day7_drawed), ErrCode::active_hasgetted);
|
|
|
+ $day_rwd = GameConfig::activity_day7_getItem($day); # 查询奖励数据
|
|
|
+ my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
|
+ StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
|
+
|
|
|
+
|
|
|
+ ctx($user);
|
|
|
+ UserProc::updateUserInfo(); # 回存
|
|
|
+ return Resp::ok(array(
|
|
|
+ 'gold' => $user->baseInfo->gold,
|
|
|
+ 'cash' => $user->baseInfo->cash,
|
|
|
+ 'tili' => $user->baseInfo->tili,
|
|
|
+ 'store' => $user->store,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 7日签到 数据更新
|
|
|
*/
|
|
|
public static function DailyResetDay7Task() {
|
|
|
if(count(ctx()->privateState->LoginDays) >= 7){
|
|
|
ctx()->privateState->LoginDays = array();
|
|
|
+ ctx()->privateState->day7_drawed = array();
|
|
|
}
|
|
|
$index = count(ctx()->privateState->LoginDays)+1;
|
|
|
ctx()->privateState->LoginDays[] = $index;
|