|
@@ -29,12 +29,34 @@ class ActiveProc {
|
|
case CmdCode::cmd_active_lottery_Tree: # 6103 转盘抽奖
|
|
case CmdCode::cmd_active_lottery_Tree: # 6103 转盘抽奖
|
|
return ActiveProc::lottery_Tree();
|
|
return ActiveProc::lottery_Tree();
|
|
case CmdCode::cmd_active_lottery_Tree_cashExchange: # 6104 元宝兑换抽奖券
|
|
case CmdCode::cmd_active_lottery_Tree_cashExchange: # 6104 元宝兑换抽奖券
|
|
- return ActiveProc::lottery_Tree_cashExchange();
|
|
|
|
|
|
+ return ActiveProc::lottery_Tree_cashExchange();
|
|
|
|
+ case CmdCode::cmd_active_lotteryNumBox_RewardReceived: # 6105 抽奖宝箱奖励领取
|
|
|
|
+ return ActiveProc::lotteryNumBox_RewardReceived();
|
|
default:
|
|
default:
|
|
Err(ErrCode::cmd_err);
|
|
Err(ErrCode::cmd_err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 6105 抽奖宝箱奖励领取
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function lotteryNumBox_RewardReceived() {
|
|
|
|
+ list($id) = req()->paras;
|
|
|
|
+
|
|
|
|
+ my_Assert(ctx()->privateState->lotteryNum >= $id,ErrCode::active_lotteryNumNotEnough);
|
|
|
|
+ my_Assert(!StlUtil::dictHasProperty(ctx()->privateState->lotteryNumRewardReceived, $id),ErrCode::active_hasgetted);
|
|
|
|
+
|
|
|
|
+ ctx()->privateState->lotteryNumRewardReceived[] = $id;
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo();
|
|
|
|
+ return Resp::ok(array(
|
|
|
|
+ "store" => ctx()->store,
|
|
|
|
+ 'cash' => ctx()->baseInfo->cash,
|
|
|
|
+ 'reward'=> StoreProc::$reward,
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 6103 转盘抽奖
|
|
* 6103 转盘抽奖
|
|
*/
|
|
*/
|
|
@@ -57,9 +79,12 @@ class ActiveProc {
|
|
$costId = $costArr[0];
|
|
$costId = $costArr[0];
|
|
$costNum = $costArr[1];
|
|
$costNum = $costArr[1];
|
|
my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum,ErrCode::notenough_item);
|
|
my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum,ErrCode::notenough_item);
|
|
- ctx()->store->removeItem($costId, $costNum);
|
|
|
|
- ctx()->privateState->lotteryNum += $num;
|
|
|
|
|
|
+ ctx()->store->removeItem($costId, $costNum);
|
|
|
|
|
|
|
|
+ if(ctx()->privateState->lotteryNum < glc()->activity_lottery_allNum){
|
|
|
|
+ ctx()->privateState->lotteryNum += $num;
|
|
|
|
+ }
|
|
|
|
+
|
|
$rewardList = array();
|
|
$rewardList = array();
|
|
$dic = GameConfig::activity_lottery_tree();
|
|
$dic = GameConfig::activity_lottery_tree();
|
|
for ($i = 0; $i < $num; $i++) {
|
|
for ($i = 0; $i < $num; $i++) {
|