|
@@ -31,10 +31,11 @@ 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,56 +62,56 @@ class PayProc {
|
|
|
return Resp::err(ErrCode::cmd_err);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 8804 累计充值
|
|
|
*/
|
|
|
- static function accumulateRechargeRewardReceived(){
|
|
|
+ static function accumulateRechargeRewardReceived() {
|
|
|
list($id) = req()->paras;
|
|
|
- $mo = GameConfig::accumulaterecharge_getItem($id);
|
|
|
+ $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);
|
|
|
-
|
|
|
+
|
|
|
+ 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)){
|
|
|
+ if (!in_array($aMo->yuanbao, ctx()->privateState->accumulateRechargeRewardRecord)) {
|
|
|
$reset = false;
|
|
|
- }
|
|
|
-
|
|
|
- if($aMo->yuanbao > $max_yuanbao){
|
|
|
+ }
|
|
|
+
|
|
|
+ if ($aMo->yuanbao > $max_yuanbao) {
|
|
|
$max_yuanbao = $aMo->yuanbao;
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- if($reset){
|
|
|
+
|
|
|
+ if ($reset) {
|
|
|
ctx()->privateState->accumulateRechargeRewardRecord = array();
|
|
|
ctx()->baseInfo->accumulateYuanBao -= $max_yuanbao;
|
|
|
- if(ctx()->baseInfo->accumulateYuanBao <= 0){
|
|
|
+ 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,
|
|
|
- ));
|
|
|
+ 'reward' => StoreProc::$reward,
|
|
|
+ 'reward_Gem' => StoreProc::$reward_Gem,
|
|
|
+ ));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
- * 8803 重置弹框
|
|
|
+ * 8803 重置弹框
|
|
|
*/
|
|
|
- static function resetFirstRechargeUI_OpenTip(){
|
|
|
+ static function resetFirstRechargeUI_OpenTip() {
|
|
|
ctx()->privateState->firstRechargeUI_OpenTip = 0;
|
|
|
UserProc::updateUserInfo();
|
|
|
return Resp::ok();
|
|
@@ -334,10 +335,10 @@ class PayProc {
|
|
|
NormalEventProc::OnPaySuccess();
|
|
|
UserProc::updateUserInfo(); # 回写玩家数据
|
|
|
return Resp::ok(array(
|
|
|
- "ret" => self::$retArr,
|
|
|
- "pay" => $user->pay,
|
|
|
- "base" => $user->baseInfo,
|
|
|
- "shopdata" => $user->shopdata,
|
|
|
+ "ret" => self::$retArr, # # 奖励串
|
|
|
+// "pay" => $user->pay,
|
|
|
+ "baseInfo" => $user->baseInfo,
|
|
|
+// "shopdata" => $user->shopdata,
|
|
|
"store" => $user->store,
|
|
|
));
|
|
|
}
|
|
@@ -931,7 +932,6 @@ class PayProc {
|
|
|
*/
|
|
|
public static function m_GetFirstPayGift() {
|
|
|
//list($day) = req()->paras;
|
|
|
-
|
|
|
// $itemId = glc()->FirstPay_ItemId;
|
|
|
// $privateState = ctx()->privateState;
|
|
|
//
|
|
@@ -946,51 +946,50 @@ class PayProc {
|
|
|
// return Resp::err(ErrCode::err_const_no);
|
|
|
// }
|
|
|
// ctx()->privateState->firstPayGift = true; # 设置首付标志
|
|
|
-
|
|
|
- my_Assert(ctx()->baseInfo->charge_amt != 0, ErrCode::pay_firstpayno_err);
|
|
|
- //my_Assert(!in_array($day, ctx()->privateState->firstRechargeRewardRecord), ErrCode::pay_repeatReceive);
|
|
|
-
|
|
|
+
|
|
|
+ my_Assert(ctx()->baseInfo->charge_amt != 0, ErrCode::pay_firstpayno_err);
|
|
|
+ //my_Assert(!in_array($day, ctx()->privateState->firstRechargeRewardRecord), ErrCode::pay_repeatReceive);
|
|
|
// $ts = TimeUtil::totalDays(ctx()->privateState->firstRechargeTs);
|
|
|
// $sTs = $ts + $day -1;
|
|
|
-// my_Assert(TimeUtil::totalDays() >= $sTs, ErrCode::pay_rewardReceive_ts_limit);
|
|
|
-
|
|
|
+// my_Assert(TimeUtil::totalDays() >= $sTs, ErrCode::pay_rewardReceive_ts_limit);
|
|
|
+
|
|
|
for ($i = 1; $i <= ctx()->privateState->firstRecharge_receiveTag; $i++) {
|
|
|
- if(!in_array($i,ctx()->privateState->firstRechargeRewardRecord)){
|
|
|
- ctx()->privateState->firstRechargeRewardRecord[] = $i;
|
|
|
+ if (!in_array($i, ctx()->privateState->firstRechargeRewardRecord)) {
|
|
|
+ ctx()->privateState->firstRechargeRewardRecord[] = $i;
|
|
|
$mo = GameConfig::firstrecharge_reward_getItem($i);
|
|
|
- my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
StoreProc::AddMultiItemInStore($mo->reward); # 发放首付礼包到玩家仓库
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
+ }
|
|
|
+
|
|
|
ctx()->privateState->firstRechargeUI_OpenTip = 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,
|
|
|
- ));
|
|
|
+ 'reward' => StoreProc::$reward,
|
|
|
+ 'reward_Gem' => StoreProc::$reward_Gem,
|
|
|
+ ));
|
|
|
}
|
|
|
|
|
|
public static function setFirstRechargeLoginTag() {
|
|
|
- if(ctx()->baseInfo->charge_amt == 0){
|
|
|
+ if (ctx()->baseInfo->charge_amt == 0) {
|
|
|
return;
|
|
|
- }
|
|
|
-
|
|
|
- if(ctx()->privateState->firstRecharge_receiveTag == 3){
|
|
|
+ }
|
|
|
+
|
|
|
+ if (ctx()->privateState->firstRecharge_receiveTag == 3) {
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
- if(ctx()->privateState->firstRecharge_receiveTag <1){
|
|
|
+
|
|
|
+ if (ctx()->privateState->firstRecharge_receiveTag < 1) {
|
|
|
return;
|
|
|
}
|
|
|
ctx()->privateState->firstRecharge_receiveTag += 1;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// </editor-fold>
|
|
|
//
|
|
|
//
|