|
@@ -488,45 +488,62 @@ class ActiveProc {
|
|
|
* 6109 战令奖励领取
|
|
|
*/
|
|
|
public static function BattlePassDrawReward() {
|
|
|
- list($type,$id) = req()->paras;
|
|
|
+ list($id) = req()->paras;
|
|
|
|
|
|
$mo = GameConfig::activity_battlepass_getItem($id); # 查询奖励数据
|
|
|
my_Assert(null != $mo, ErrCode::err_const_no); # 防御找不到配置
|
|
|
$subFunType = $mo->type;
|
|
|
$typeId = $mo->typeId;
|
|
|
- $str = $subFunType.'-'.$type.'-'.$typeId;
|
|
|
|
|
|
+ $str_1 = $subFunType.'-1-'.$typeId;
|
|
|
+ $str_2 = $subFunType.'-2-'.$typeId;
|
|
|
+ $isHasBuy_high = false;
|
|
|
switch ($subFunType) {
|
|
|
case Enum_SubFunType::ActivePoint_BattlePass:
|
|
|
$point =ctx()->privateState->battlePass_taskPoint;
|
|
|
my_Assert($typeId >= $point, ErrCode::active_pointNotEnough);
|
|
|
-
|
|
|
+
|
|
|
+ if(ctx()->privateState->battlePass_activePoint_cost_ts > 0 && now() < ctx()->privateState->battlePass_activePoint_cost_ts + 30*24*60*60){
|
|
|
+ $isHasBuy_high = true;
|
|
|
+ }
|
|
|
+
|
|
|
break;
|
|
|
case Enum_SubFunType::Tili_BattleBass:
|
|
|
my_Assert($typeId >= ctx()->privateData()->battlePass_tili, ErrCode::active_costTiliNotEnough);
|
|
|
-
|
|
|
+ if(ctx()->privateState->battlePass_tili_cost_ts > 0 && now() < ctx()->privateState->battlePass_tili_cost_ts + 30*24*60*60){
|
|
|
+ $isHasBuy_high = true;
|
|
|
+ }
|
|
|
break;
|
|
|
case Enum_SubFunType::Gate_BattleBass:
|
|
|
my_Assert(StlUtil::dictHasProperty(ctx()->gates->GateList,$typeId), ErrCode::gate_GateNoUnlock);
|
|
|
my_Assert(ctx()->gates->GateList->$typeId->pass > 0, ErrCode::evolve_GateNoPass);
|
|
|
-
|
|
|
+
|
|
|
+ if(ctx()->privateState->battlePass_gate_cost_ts > 0 && now() < ctx()->privateState->battlePass_gate_cost_ts + 30*24*60*60){
|
|
|
+ $isHasBuy_high = true;
|
|
|
+ }
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
- my_Assert(!in_array($str, ctx()->privateState->battlePassRewardReceived), ErrCode::active_hasgetted);
|
|
|
- $key = 'rewards_'.$type;
|
|
|
- StoreProc::AddMultiItemInStore($mo->$key); # 发放奖励
|
|
|
|
|
|
- ctx()->privateData(true)->battlePassRewardReceived[] = $str;
|
|
|
-
|
|
|
+ if(!in_array($str_1, ctx()->privateState->battlePassRewardReceived)){
|
|
|
+ StoreProc::AddMultiItemInStore($mo->rewards_1); # 发放奖励
|
|
|
+ ctx()->privateData(true)->battlePassRewardReceived[] = $str_1;
|
|
|
+ }
|
|
|
+
|
|
|
+ //my_Assert(!in_array($str_1, ctx()->privateState->battlePassRewardReceived), ErrCode::active_hasgetted);
|
|
|
+ if($isHasBuy_high && !in_array($str_2, ctx()->privateState->battlePassRewardReceived)){
|
|
|
+ StoreProc::AddMultiItemInStore($mo->rewards_2); # 发放奖励
|
|
|
+ ctx()->privateData(true)->battlePassRewardReceived[] = $str_2;
|
|
|
+ }
|
|
|
+
|
|
|
UserProc::updateUserInfo(); # 回存
|
|
|
return Resp::ok(array('gold' => ctx()->baseInfo->gold,
|
|
|
'cash' => ctx()->baseInfo->cash,
|
|
|
'store' => ctx()->store,
|
|
|
'heros' => ctx()->heros,
|
|
|
- //'privateState' => ctx()->privateState,
|
|
|
+ 'privateState' => ctx()->privateState,
|
|
|
'reward' => StoreProc::$reward,
|
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
|
));
|