|
@@ -31,8 +31,10 @@ class PayProc {
|
|
|
// 支付相关的活动
|
|
|
case CmdCode::cmd_pay_getfirstpaygift: # 8802 领取首充礼包
|
|
|
return PayProc::m_GetFirstPayGift();
|
|
|
- case CmdCode::cmd_pay_resetFirstRechargeUI_OpenTip: # 8803 弹框
|
|
|
+ case CmdCode::cmd_pay_resetFirstRechargeUI_OpenTip: # 8803 重置弹框
|
|
|
return PayProc::resetFirstRechargeUI_OpenTip();
|
|
|
+ case CmdCode::cmd_pay_accumulateRechargeRewardReceived: # 8804 累计充值领取奖励
|
|
|
+ return PayProc::accumulateRechargeRewardReceived();
|
|
|
// 游戏内二级货币消费
|
|
|
case CmdCode::cmd_mpay_pay: # 8807 消费..
|
|
|
return self::m_pay(); # ::==> 购买普通商城物品
|
|
@@ -61,7 +63,52 @@ class PayProc {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
+ * 8804 累计充值
|
|
|
+ */
|
|
|
+ static function accumulateRechargeRewardReceived(){
|
|
|
+ list($id) = req()->paras;
|
|
|
+ $mo = GameConfig::accumulaterecharge_getItem($id);
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
+
|
|
|
+ my_Assert(ctx()->baseInfo->accumulateYuanBao >= $id , ErrCode::pay_accumulateYuanBaoNotEnough);
|
|
|
+ my_Assert(in_array($id, ctx()->privateState->accumulateRechargeRewardRecord) , ErrCode::pay_repeatReceive);
|
|
|
+
|
|
|
+ ctx()->privateState->accumulateRechargeRewardRecord[] = $id;
|
|
|
+ StoreProc::AddMultiItemInStore($mo->reward);
|
|
|
+
|
|
|
+ $reset = true;
|
|
|
+ $dic = GameConfig::accumulaterecharge();
|
|
|
+ $max_yuanbao = 0;
|
|
|
+ foreach ($dic as $aMo) {
|
|
|
+ if(!in_array($aMo->yuanbao, ctx()->privateState->accumulateRechargeRewardRecord)){
|
|
|
+ $reset = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if($aMo->yuanbao > $max_yuanbao){
|
|
|
+ $max_yuanbao = $aMo->yuanbao;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if($reset){
|
|
|
+ ctx()->privateState->accumulateRechargeRewardRecord = array();
|
|
|
+ ctx()->baseInfo->accumulateYuanBao -= $max_yuanbao;
|
|
|
+ if(ctx()->baseInfo->accumulateYuanBao <= 0){
|
|
|
+ ctx()->baseInfo->accumulateYuanBao = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ UserProc::updateUserInfo();
|
|
|
+ return Resp::ok(array('gold' => ctx()->baseInfo->gold,
|
|
|
+ 'cash' => ctx()->baseInfo->cash,
|
|
|
+ 'store' => ctx()->store,
|
|
|
+ 'privateState' => ctx()->privateState,
|
|
|
+ 'reward'=> StoreProc::$reward,
|
|
|
+ 'reward_Gem'=> StoreProc::$reward_Gem,
|
|
|
+ ));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 8803 重置弹框
|
|
|
*/
|
|
|
static function resetFirstRechargeUI_OpenTip(){
|
|
|
ctx()->privateState->firstRechargeUI_OpenTip = 0;
|