|
@@ -36,11 +36,13 @@ class ActiveProc {
|
|
return ActiveProc::LotteryExchangeItem();
|
|
return ActiveProc::LotteryExchangeItem();
|
|
case CmdCode::cmd_active_day7_accumulateDrawreward: # 6107 7日签到 累计天数宝箱奖励领取
|
|
case CmdCode::cmd_active_day7_accumulateDrawreward: # 6107 7日签到 累计天数宝箱奖励领取
|
|
return ActiveProc::Day7_AccumulateDrawreward();
|
|
return ActiveProc::Day7_AccumulateDrawreward();
|
|
|
|
+ case CmdCode::cmd_active_limitTsBuy: # 6108 限时贩售
|
|
|
|
+ return ActiveProc::LimitTsBuy_Drawreward();
|
|
default:
|
|
default:
|
|
Err(ErrCode::cmd_err);
|
|
Err(ErrCode::cmd_err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
static function ResetActive() {
|
|
static function ResetActive() {
|
|
|
|
|
|
}
|
|
}
|
|
@@ -323,7 +325,7 @@ class ActiveProc {
|
|
ctx()->privateState->LoginDays[] = $index;
|
|
ctx()->privateState->LoginDays[] = $index;
|
|
ctx()->privateState->day7_accumulate += 1;
|
|
ctx()->privateState->day7_accumulate += 1;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 6101 签到
|
|
* 6101 签到
|
|
* @return type
|
|
* @return type
|
|
@@ -394,6 +396,70 @@ class ActiveProc {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+ 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,
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 限时贩卖 2天一刷
|
|
|
|
+ */
|
|
|
|
+ public static function ResetLimitTsBuy() {
|
|
|
|
+ $mo = GameConfig::subfun_unlock_getItem(Enum_SubFunType::LimitTsSale);
|
|
|
|
+ $startDay = TimeUtil::totalDays($mo->startTs);
|
|
|
|
+ $nextDay = TimeUtil::totalDays();
|
|
|
|
+
|
|
|
|
+ $num = $nextDay - $startDay;
|
|
|
|
+ $val = intval($num / 2);
|
|
|
|
+ $yushu = $val % 5;
|
|
|
|
+ $type = $yushu +1;
|
|
|
|
+
|
|
|
|
+ $arr = GameConfig::activity_promopackinfo_type_getItemArray($type);
|
|
|
|
+ $count = count($arr);
|
|
|
|
+
|
|
|
|
+ $ret = array();
|
|
|
|
+ if($count == 6){
|
|
|
|
+ $ret = $arr;
|
|
|
|
+ } else {
|
|
|
|
+ for ($i = 0; $i < 6; $i++) {
|
|
|
|
+ $count = count($arr);
|
|
|
|
+ $rand = rand(0,$count-1);
|
|
|
|
+ $ret[] = $arr[$rand];
|
|
|
|
+ StlUtil::arrayRemoveAt($arr, $rand);
|
|
|
|
+ if(count($arr) == 0){
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ ctx()->privateState->limitTsBuy_RandIds = array();
|
|
|
|
+ foreach ($ret as $mo) {
|
|
|
|
+ ctx()->privateState->limitTsBuy_RandIds[] = $mo->typeId;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6108 限时贩售
|
|
|
|
+ */
|
|
|
|
+ public static function LimitTsBuy_Drawreward() {
|
|
|
|
+ list($typeId) = req()->paras; # 参数: 领取第x天的奖励
|
|
|
|
+
|
|
|
|
+ my_Assert(in_array($typeId, ctx()->privateState->limitTsBuy_RewardRecord), ErrCode::active_const_no_err);
|
|
|
|
+ $mo = GameConfig::activity_promopackinfo_getItem($typeId); # 查询奖励数据
|
|
|
|
+ my_Assert(null != $mo, ErrCode::err_const_no); # 防御找不到配置
|
|
|
|
+
|
|
|
|
+ $rewardArr = ctx()->privateState->limitTsBuy_RewardRecord;
|
|
|
|
+ $count = array_count_values(array_keys($rewardArr, $typeId))[$typeId];
|
|
|
|
+ my_Assert($count < $mo->limitNum, ErrCode::user_shop_LimitNum);
|
|
|
|
+
|
|
|
|
+ StoreProc::AddMultiItemInStore($mo->reward); # 发放奖励
|
|
|
|
+ ctx()->privateState->limitTsBuy_RewardRecord[] = $typeId;
|
|
|
|
+
|
|
UserProc::updateUserInfo(); # 回存
|
|
UserProc::updateUserInfo(); # 回存
|
|
return Resp::ok(array('gold' => ctx()->baseInfo->gold,
|
|
return Resp::ok(array('gold' => ctx()->baseInfo->gold,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
'cash' => ctx()->baseInfo->cash,
|