|
@@ -34,125 +34,126 @@ class ActiveProc {
|
|
return ActiveProc::lotteryNumBox_RewardReceived();
|
|
return ActiveProc::lotteryNumBox_RewardReceived();
|
|
case CmdCode::cmd_active_LotteryExchangeItem: # 6106 兑换
|
|
case CmdCode::cmd_active_LotteryExchangeItem: # 6106 兑换
|
|
return ActiveProc::LotteryExchangeItem();
|
|
return ActiveProc::LotteryExchangeItem();
|
|
|
|
+ case CmdCode::cmd_active_day7_accumulateDrawreward: # 6107 7日签到 累计天数宝箱奖励领取
|
|
|
|
+ return ActiveProc::Day7_AccumulateDrawreward();
|
|
default:
|
|
default:
|
|
Err(ErrCode::cmd_err);
|
|
Err(ErrCode::cmd_err);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
- static function ResetActive() {
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ static function ResetActive() {
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* 6106 抽奖里面的兑换
|
|
* 6106 抽奖里面的兑换
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
public static function LotteryExchangeItem() {
|
|
public static function LotteryExchangeItem() {
|
|
list($id) = req()->paras;
|
|
list($id) = req()->paras;
|
|
-
|
|
|
|
|
|
+
|
|
$arr = array_count_values(ctx()->privateState->lotteryExchange);
|
|
$arr = array_count_values(ctx()->privateState->lotteryExchange);
|
|
$num = $arr[$id];
|
|
$num = $arr[$id];
|
|
-
|
|
|
|
- $mo = GameConfig::activity_lotteryitem_exchange_getItem($id);
|
|
|
|
- my_Assert($mo != null,ErrCode::err_const_no);
|
|
|
|
- my_Assert($num < $mo->exchangeNum,ErrCode::active_lotteryExchangeNumLimit);
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+ $mo = GameConfig::activity_lotteryitem_exchange_getItem($id);
|
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
+ my_Assert($num < $mo->exchangeNum, ErrCode::active_lotteryExchangeNumLimit);
|
|
|
|
+
|
|
$itemNum = 0;
|
|
$itemNum = 0;
|
|
- $cost = explode(',',$mo->cost);
|
|
|
|
|
|
+ $cost = explode(',', $mo->cost);
|
|
$costId = $cost[0];
|
|
$costId = $cost[0];
|
|
- if(StlUtil::dictHasProperty(ctx()->store->items, $costId)){
|
|
|
|
|
|
+ if (StlUtil::dictHasProperty(ctx()->store->items, $costId)) {
|
|
$itemNum = ctx()->store->items->$costId;
|
|
$itemNum = ctx()->store->items->$costId;
|
|
}
|
|
}
|
|
-
|
|
|
|
- my_Assert($itemNum >= $cost[1],ErrCode::notenough_item);
|
|
|
|
|
|
+
|
|
|
|
+ my_Assert($itemNum >= $cost[1], ErrCode::notenough_item);
|
|
ctx()->store->removeItem($costId, $cost[1]);
|
|
ctx()->store->removeItem($costId, $cost[1]);
|
|
-
|
|
|
|
|
|
+
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
ctx()->privateState->lotteryExchange[] = $id;
|
|
ctx()->privateState->lotteryExchange[] = $id;
|
|
-
|
|
|
|
|
|
+
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
return Resp::ok(array(
|
|
return Resp::ok(array(
|
|
- "store" => ctx()->store,
|
|
|
|
|
|
+ "store" => ctx()->store,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
- 'gold'=> ctx()->baseInfo->gold,
|
|
|
|
- 'reward'=> StoreProc::$reward,
|
|
|
|
|
|
+ 'gold' => ctx()->baseInfo->gold,
|
|
|
|
+ 'reward' => StoreProc::$reward,
|
|
));
|
|
));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 6105 抽奖宝箱奖励领取
|
|
* 6105 抽奖宝箱奖励领取
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
public static function lotteryNumBox_RewardReceived() {
|
|
public static function lotteryNumBox_RewardReceived() {
|
|
list($id) = req()->paras;
|
|
list($id) = req()->paras;
|
|
-
|
|
|
|
|
|
+
|
|
$mo = GameConfig::activity_lotterynum_accumulate_getItem($id);
|
|
$mo = GameConfig::activity_lotterynum_accumulate_getItem($id);
|
|
- my_Assert($mo != null,ErrCode::err_const_no);
|
|
|
|
- my_Assert(ctx()->privateState->lotteryNum >= $id,ErrCode::active_lotteryNumNotEnough);
|
|
|
|
- my_Assert(!in_array($id,ctx()->privateState->lotteryNumRewardReceived),ErrCode::active_hasgetted);
|
|
|
|
-
|
|
|
|
|
|
+ my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
+ my_Assert(ctx()->privateState->lotteryNum >= $id, ErrCode::active_lotteryNumNotEnough);
|
|
|
|
+ my_Assert(!in_array($id, ctx()->privateState->lotteryNumRewardReceived), ErrCode::active_hasgetted);
|
|
|
|
+
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
ctx()->privateState->lotteryNumRewardReceived[] = $id;
|
|
ctx()->privateState->lotteryNumRewardReceived[] = $id;
|
|
-
|
|
|
|
|
|
+
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
return Resp::ok(array(
|
|
return Resp::ok(array(
|
|
- "store" => ctx()->store,
|
|
|
|
|
|
+ "store" => ctx()->store,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
- 'reward'=> StoreProc::$reward,
|
|
|
|
|
|
+ 'reward' => StoreProc::$reward,
|
|
));
|
|
));
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 6103 转盘抽奖
|
|
* 6103 转盘抽奖
|
|
*/
|
|
*/
|
|
public static function lottery_Tree() {
|
|
public static function lottery_Tree() {
|
|
- list($num) = req()->paras;//抽奖次数 1 10
|
|
|
|
-
|
|
|
|
- $arr = array(1,10);
|
|
|
|
- my_Assert(in_array($num, $arr),ErrCode::active_lotteryNumErr);
|
|
|
|
- my_Assert(ctx()->privateState->lotteryNum + $num <= glc()->activity_lottery_allNum,ErrCode::active_lotteryNumLimit);
|
|
|
|
-
|
|
|
|
- $cost ="";
|
|
|
|
- if($num == 1){
|
|
|
|
|
|
+ list($num) = req()->paras; //抽奖次数 1 10
|
|
|
|
+
|
|
|
|
+ $arr = array(1, 10);
|
|
|
|
+ my_Assert(in_array($num, $arr), ErrCode::active_lotteryNumErr);
|
|
|
|
+ my_Assert(ctx()->privateState->lotteryNum + $num <= glc()->activity_lottery_allNum, ErrCode::active_lotteryNumLimit);
|
|
|
|
+
|
|
|
|
+ $cost = "";
|
|
|
|
+ if ($num == 1) {
|
|
$cost = glc()->activity_lottery_tree_one_cost;
|
|
$cost = glc()->activity_lottery_tree_one_cost;
|
|
} else {
|
|
} else {
|
|
$cost = glc()->activity_lottery_tree_ten_cost;
|
|
$cost = glc()->activity_lottery_tree_ten_cost;
|
|
}
|
|
}
|
|
- my_Assert($cost != "",ErrCode::active_lotteryCostErr);
|
|
|
|
- $costArr = explode(',', $cost);
|
|
|
|
- $item = ctx()->store->items;
|
|
|
|
|
|
+ my_Assert($cost != "", ErrCode::active_lotteryCostErr);
|
|
|
|
+ $costArr = explode(',', $cost);
|
|
|
|
+ $item = ctx()->store->items;
|
|
$costId = $costArr[0];
|
|
$costId = $costArr[0];
|
|
$costNum = $costArr[1];
|
|
$costNum = $costArr[1];
|
|
- my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum,ErrCode::notenough_item);
|
|
|
|
- ctx()->store->removeItem($costId, $costNum);
|
|
|
|
-
|
|
|
|
- if(ctx()->privateState->lotteryNum < glc()->activity_lottery_allNum){
|
|
|
|
- ctx()->privateState->lotteryNum += $num;
|
|
|
|
|
|
+ my_Assert(StlUtil::dictHasProperty($item, $costId) && $item->$costId >= $costNum, ErrCode::notenough_item);
|
|
|
|
+ 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++) {
|
|
$randNum = random_int(1, 10000);
|
|
$randNum = random_int(1, 10000);
|
|
- $start = 0;
|
|
|
|
|
|
+ $start = 0;
|
|
$end = 0;
|
|
$end = 0;
|
|
foreach ($dic as $id => $mo) {
|
|
foreach ($dic as $id => $mo) {
|
|
$end += $mo->per * 10000;
|
|
$end += $mo->per * 10000;
|
|
- if($randNum > $start && $randNum <= $end){
|
|
|
|
|
|
+ if ($randNum > $start && $randNum <= $end) {
|
|
$rewardList[] = $id;
|
|
$rewardList[] = $id;
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
StoreProc::AddMultiItemInStore($mo->reward);
|
|
$prize = explode(',', $mo->reward);
|
|
$prize = explode(',', $mo->reward);
|
|
- if(GameConfig::item_getItem($prize[0])->itemType == 201 && GameConfig::item_getItem($prize[0])->quality >= 4 && ctx()->privateState->lottery_qualGem_4 == 0){
|
|
|
|
|
|
+ if (GameConfig::item_getItem($prize[0])->itemType == 201 && GameConfig::item_getItem($prize[0])->quality >= 4 && ctx()->privateState->lottery_qualGem_4 == 0) {
|
|
ctx()->privateState->lottery_qualGem_4 = 1;
|
|
ctx()->privateState->lottery_qualGem_4 = 1;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
$start = $end;
|
|
$start = $end;
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
return Resp::ok(array(
|
|
return Resp::ok(array(
|
|
"store" => ctx()->store,
|
|
"store" => ctx()->store,
|
|
@@ -160,9 +161,8 @@ class ActiveProc {
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
'gold' => ctx()->baseInfo->gold,
|
|
'gold' => ctx()->baseInfo->gold,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
'cash' => ctx()->baseInfo->cash,
|
|
- 'lotteryNum'=> ctx()->privateState->lotteryNum,
|
|
|
|
- 'indexReward'=> $rewardList,
|
|
|
|
-
|
|
|
|
|
|
+ 'lotteryNum' => ctx()->privateState->lotteryNum,
|
|
|
|
+ 'indexReward' => $rewardList,
|
|
));
|
|
));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -171,40 +171,39 @@ class ActiveProc {
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
public static function lottery_Tree_cashExchange() {
|
|
public static function lottery_Tree_cashExchange() {
|
|
- list($num) = req()->paras;//抽奖次数 1 10
|
|
|
|
-
|
|
|
|
- $cost ="";
|
|
|
|
- if($num == 1){
|
|
|
|
|
|
+ list($num) = req()->paras; //抽奖次数 1 10
|
|
|
|
+
|
|
|
|
+ $cost = "";
|
|
|
|
+ if ($num == 1) {
|
|
$cost = glc()->activity_lottery_tree_one_cost;
|
|
$cost = glc()->activity_lottery_tree_one_cost;
|
|
} else {
|
|
} else {
|
|
$cost = glc()->activity_lottery_tree_ten_cost;
|
|
$cost = glc()->activity_lottery_tree_ten_cost;
|
|
}
|
|
}
|
|
- my_Assert($cost != "",ErrCode::active_lotteryCostErr);
|
|
|
|
- $costArr = explode(',', $cost);
|
|
|
|
- $item = ctx()->store->items;
|
|
|
|
|
|
+ my_Assert($cost != "", ErrCode::active_lotteryCostErr);
|
|
|
|
+ $costArr = explode(',', $cost);
|
|
|
|
+ $item = ctx()->store->items;
|
|
$costId = $costArr[0];
|
|
$costId = $costArr[0];
|
|
$costNum = $costArr[1];
|
|
$costNum = $costArr[1];
|
|
-
|
|
|
|
|
|
+
|
|
$selfNum = 0;
|
|
$selfNum = 0;
|
|
- if(StlUtil::dictHasProperty($item, $costId)){
|
|
|
|
|
|
+ if (StlUtil::dictHasProperty($item, $costId)) {
|
|
$selfNum = $item->$costId;
|
|
$selfNum = $item->$costId;
|
|
}
|
|
}
|
|
- my_Assert($selfNum < $costNum,ErrCode::active_lottery_unwantedExchange);
|
|
|
|
-
|
|
|
|
|
|
+ my_Assert($selfNum < $costNum, ErrCode::active_lottery_unwantedExchange);
|
|
|
|
+
|
|
$costNum -= $selfNum;
|
|
$costNum -= $selfNum;
|
|
$cash = glc()->activity_lottery_oneCost_cash * $costNum;
|
|
$cash = glc()->activity_lottery_oneCost_cash * $costNum;
|
|
- my_Assert(ctx()->baseInfo->cash >= $cash,ErrCode::notenough_cash_msg);
|
|
|
|
|
|
+ my_Assert(ctx()->baseInfo->cash >= $cash, ErrCode::notenough_cash_msg);
|
|
ctx()->baseInfo->Consume_Cash($cash);
|
|
ctx()->baseInfo->Consume_Cash($cash);
|
|
- StoreProc::AddMultiItemInStore($costId.','.$costNum);
|
|
|
|
-
|
|
|
|
|
|
+ StoreProc::AddMultiItemInStore($costId . ',' . $costNum);
|
|
|
|
+
|
|
UserProc::updateUserInfo();
|
|
UserProc::updateUserInfo();
|
|
return Resp::ok(array(
|
|
return Resp::ok(array(
|
|
- "store" => ctx()->store,
|
|
|
|
- 'cash' => ctx()->baseInfo->cash,
|
|
|
|
|
|
+ "store" => ctx()->store,
|
|
|
|
+ 'cash' => ctx()->baseInfo->cash,
|
|
));
|
|
));
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 6102 兑换码礼包
|
|
* 6102 兑换码礼包
|
|
*/
|
|
*/
|
|
@@ -221,7 +220,7 @@ class ActiveProc {
|
|
my_Assert(!in_array($packageInfo->id, ctx()->privateState->usedTokens), ErrCode::active_hasgetted); # 已经领取过该礼包了
|
|
my_Assert(!in_array($packageInfo->id, ctx()->privateState->usedTokens), ErrCode::active_hasgetted); # 已经领取过该礼包了
|
|
$packageID = $packageInfo->id;
|
|
$packageID = $packageInfo->id;
|
|
//$err = StoreProc::AddMultiItemInStore($packageInfo->reward); # 发放礼包
|
|
//$err = StoreProc::AddMultiItemInStore($packageInfo->reward); # 发放礼包
|
|
- EmailProc::SendPackageByCodeMail(req()->zoneid, req()->uid, $packageInfo->reward);
|
|
|
|
|
|
+ EmailProc::SendPackageByCodeMail(req()->zoneid, req()->uid, $packageInfo->reward);
|
|
my_Assert(ErrCode::ok == $err, $err);
|
|
my_Assert(ErrCode::ok == $err, $err);
|
|
} else {
|
|
} else {
|
|
$active = GameConfig::activity_getItem($activeId); # 活动数据
|
|
$active = GameConfig::activity_getItem($activeId); # 活动数据
|
|
@@ -252,7 +251,7 @@ class ActiveProc {
|
|
$ok = self::setActiveCodeUserRecord($activeCode, req()->uid); # 插入数据库
|
|
$ok = self::setActiveCodeUserRecord($activeCode, req()->uid); # 插入数据库
|
|
my_Assert($ok, ErrCode::err_db); # 数据库操作失败- 重试
|
|
my_Assert($ok, ErrCode::err_db); # 数据库操作失败- 重试
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
ctx()->privateState->usedTokens[] = $packageID;
|
|
ctx()->privateState->usedTokens[] = $packageID;
|
|
|
|
|
|
UserProc::updateUserInfo(); # 回存玩家数据
|
|
UserProc::updateUserInfo(); # 回存玩家数据
|
|
@@ -264,11 +263,11 @@ class ActiveProc {
|
|
'cash' => ctx()->base()->cash,
|
|
'cash' => ctx()->base()->cash,
|
|
//'tili' => ctx()->base()->tili,
|
|
//'tili' => ctx()->base()->tili,
|
|
'store' => ctx()->store,
|
|
'store' => ctx()->store,
|
|
- //'hero' => ctx()->heros,
|
|
|
|
|
|
+ //'hero' => ctx()->heros,
|
|
);
|
|
);
|
|
return Resp::ok($ret); # 返回成功信息
|
|
return Resp::ok($ret); # 返回成功信息
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
public static function PublicTokenCodeCheck($codestring) {
|
|
public static function PublicTokenCodeCheck($codestring) {
|
|
$dic = GameConfig::token_PublicGift();
|
|
$dic = GameConfig::token_PublicGift();
|
|
if (StlUtil::dictHasProperty($dic, $codestring)) {
|
|
if (StlUtil::dictHasProperty($dic, $codestring)) {
|
|
@@ -276,7 +275,7 @@ class ActiveProc {
|
|
}
|
|
}
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 检查兑换码是否已经使用过了
|
|
* 检查兑换码是否已经使用过了
|
|
* @param ActiveCode $activeCode
|
|
* @param ActiveCode $activeCode
|
|
@@ -311,14 +310,18 @@ class ActiveProc {
|
|
/**
|
|
/**
|
|
* 7日签到 数据更新
|
|
* 7日签到 数据更新
|
|
*/
|
|
*/
|
|
- public static function DailyResetDay7Task() {
|
|
|
|
-// if (count(ctx()->privateState->LoginDays) >= 7) {
|
|
|
|
-// ctx()->privateState->LoginDays = array();
|
|
|
|
-// ctx()->privateState->day7_drawed = array();
|
|
|
|
-// }
|
|
|
|
-// $index = count(ctx()->privateState->LoginDays) + 1;
|
|
|
|
-// ctx()->privateState->LoginDays[] = $index;
|
|
|
|
-// ctx()->privateState->day7_accumulate += 1;
|
|
|
|
|
|
+ public static function DailyResetDay7Task($unlock = false) {
|
|
|
|
+ if(!$unlock && !FightProc::isFunUnlock(Enum_SubFunType::Day7_Sign)){//之所以这有两个判断是因为这个 活动解锁的代码监测位置问题,fightProc 里解锁监测代码在 $gateInfo->tz_state = $index;之前了 这个位置没有办法解锁
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (count(ctx()->privateState->LoginDays) >= 7) {
|
|
|
|
+ ctx()->privateState->LoginDays = array();
|
|
|
|
+ ctx()->privateState->day7_drawed = array();
|
|
|
|
+ }
|
|
|
|
+ $index = count(ctx()->privateState->LoginDays) + 1;
|
|
|
|
+ ctx()->privateState->LoginDays[] = $index;
|
|
|
|
+ ctx()->privateState->day7_accumulate += 1;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -326,29 +329,59 @@ class ActiveProc {
|
|
* @return type
|
|
* @return type
|
|
*/
|
|
*/
|
|
public static function Day7_DrawReward() {
|
|
public static function Day7_DrawReward() {
|
|
- list($day) = req()->paras; # 参数: 领取第x天的奖励
|
|
|
|
|
|
+ list($day) = req()->paras; # 参数: 领取第x天的奖励
|
|
|
|
|
|
- $mo = GameConfig::subfun_unlock_getItem(2);
|
|
|
|
- my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
- my_Assert(now() >= $mo->startTs && now()->$mo->endTs, ErrCode::active_time);
|
|
|
|
-
|
|
|
|
- $startDay = TimeUtil::totalDays($mo->startTs);
|
|
|
|
- $curDay = TimeUtil::totalDays(now());
|
|
|
|
- $n = $curDay - $startDay;
|
|
|
|
-
|
|
|
|
- my_Assert($day <= $n+1, ErrCode::active_day7_expired);
|
|
|
|
- my_Assert(!in_array($day.'-1', ctx()->privateState->day7_drawed), ErrCode::active_hasgetted);
|
|
|
|
|
|
+ my_Assert(in_array($day, ctx()->privateState->LoginDays), ErrCode::active_day7_expired);
|
|
|
|
+ my_Assert(!in_array($day, ctx()->privateState->day7_drawed), ErrCode::active_hasgetted);
|
|
$day_rwd = GameConfig::activity_day7_getItem($day); # 查询奖励数据
|
|
$day_rwd = GameConfig::activity_day7_getItem($day); # 查询奖励数据
|
|
my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
-
|
|
|
|
- ctx()->privateState->day7_drawed[] = $day.'-1'; # 添加领取记录
|
|
|
|
-
|
|
|
|
- UserProc::updateUserInfo();
|
|
|
|
|
|
+ ctx()->privateState->day7_drawed[] = $day; # 添加领取记录
|
|
|
|
+
|
|
|
|
+ UserProc::updateUserInfo(); # 回存
|
|
|
|
+ return Resp::ok(array('gold' => ctx()->baseInfo->gold,
|
|
|
|
+ 'cash' => ctx()->baseInfo->cash,
|
|
|
|
+ 'store' => ctx()->store,
|
|
|
|
+ //'day7_drawed;' => ctx()->privateState->day7_drawed,
|
|
|
|
+ 'reward' => StoreProc::$reward,
|
|
|
|
+ 'reward_Gem' => StoreProc::$reward_Gem,
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 6107 7日签到 累计天数宝箱奖励领取
|
|
|
|
+ * @return type
|
|
|
|
+ */
|
|
|
|
+ public static function Day7_AccumulateDrawreward() {
|
|
|
|
+ list($day) = req()->paras; # 参数: 领取第x天的奖励
|
|
|
|
+
|
|
|
|
+ $yushu = $day % 10;
|
|
|
|
+ if ($yushu == 0) {
|
|
|
|
+ $num = $day / 10;
|
|
|
|
+ if ($num > 6) {
|
|
|
|
+ $n = $num % 6;
|
|
|
|
+ $typeId = $n * 10;
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ $typeId = $yushu;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ my_Assert(ctx()->privateState->day7_accumulate >= $day, ErrCode::active_day7_expired);
|
|
|
|
+ my_Assert(!in_array($day, ctx()->privateState->day7_accumulateDrawed), ErrCode::active_hasgetted);
|
|
|
|
+ $day_rwd = GameConfig::active_day7_accumulate_getItem($typeId); # 查询奖励数据
|
|
|
|
+ my_Assert(null != $day_rwd, ErrCode::err_const_no); # 防御找不到配置
|
|
|
|
+ StoreProc::AddMultiItemInStore($day_rwd->reward); # 发放奖励
|
|
|
|
+ ctx()->privateState->day7_accumulateDrawed[] = $day;
|
|
|
|
+ if ($typeId % 10 == 0) {
|
|
|
|
+ ctx()->privateState->day7_accumulate_loopNum += 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ 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,
|
|
'store' => ctx()->store,
|
|
'store' => ctx()->store,
|
|
- 'day7_drawed;' => ctx()->privateState->day7_drawed,
|
|
|
|
|
|
+ //'day7_drawed;' => ctx()->privateState->day7_drawed,
|
|
'reward' => StoreProc::$reward,
|
|
'reward' => StoreProc::$reward,
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
'reward_Gem' => StoreProc::$reward_Gem,
|
|
));
|
|
));
|