|
@@ -37,12 +37,12 @@ class ShopProc {
|
|
$addTili = 0;
|
|
$addTili = 0;
|
|
if ($type == 1) {//广告
|
|
if ($type == 1) {//广告
|
|
$maxNum = glc()->GuanggaoGetTili_DailyMaxNum;
|
|
$maxNum = glc()->GuanggaoGetTili_DailyMaxNum;
|
|
- my_Assert(ctx()->privateState->guanggaoGetTiliNum < $maxNum, ErrCode::user_shop_GuanggaoGetTiliNumLimit);
|
|
|
|
- my_Assert(now() - ctx()->privateState->guanggaoGetTili_ts > 300, ErrCode::user_shop_DownTsLimit);
|
|
|
|
|
|
+ my_Assert(ctx()->privateState->guanggaoGetTiliNum < $maxNum, ErrCode::user_shop_GuanggaoGetTiliNumLimit);
|
|
|
|
+ my_Assert(now() - ctx()->privateState->guanggaoGetTili_ts > 300, ErrCode::user_shop_DownTsLimit);
|
|
$addTili = glc()->GuanggaoGetTili;
|
|
$addTili = glc()->GuanggaoGetTili;
|
|
ctx()->baseInfo->Add_tili(glc()->GuanggaoGetTili);
|
|
ctx()->baseInfo->Add_tili(glc()->GuanggaoGetTili);
|
|
ctx()->privateState->guanggaoGetTiliNum += 1;
|
|
ctx()->privateState->guanggaoGetTiliNum += 1;
|
|
-
|
|
|
|
|
|
+
|
|
ctx()->privateState->guanggaoGetTili_ts = now();
|
|
ctx()->privateState->guanggaoGetTili_ts = now();
|
|
} else {
|
|
} else {
|
|
$maxNum = glc()->BuyTili_DailyMaxNum;
|
|
$maxNum = glc()->BuyTili_DailyMaxNum;
|
|
@@ -167,16 +167,7 @@ class ShopProc {
|
|
case EnumShopGift::GemBox_Shop ://宝石宝箱
|
|
case EnumShopGift::GemBox_Shop ://宝石宝箱
|
|
$mo = GameConfig::shop_box_getItem($typeId);
|
|
$mo = GameConfig::shop_box_getItem($typeId);
|
|
my_Assert($mo != null, ErrCode::err_const_no);
|
|
my_Assert($mo != null, ErrCode::err_const_no);
|
|
-
|
|
|
|
- if ($buyNum > 0) {
|
|
|
|
- $cost = $mo->cost_ten;
|
|
|
|
- if ($buyNum == 1) {
|
|
|
|
- $cost = $mo->cost_one;
|
|
|
|
- }
|
|
|
|
- my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
|
|
|
|
- $user->baseInfo->Consume_Cash($cost);
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+
|
|
if ($mo->type == 1) {
|
|
if ($mo->type == 1) {
|
|
if ($buyNum == 0) {
|
|
if ($buyNum == 0) {
|
|
$buyNum = 1;
|
|
$buyNum = 1;
|
|
@@ -190,6 +181,22 @@ class ShopProc {
|
|
$user->privateState->lastFreeGetTs_ShopBoxBright = now();
|
|
$user->privateState->lastFreeGetTs_ShopBoxBright = now();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ if ($buyNum == 1) {
|
|
|
|
+ $cost = $mo->cost_one;
|
|
|
|
+ $yaoshiArr = explode(',', $mo->cost_one_yaoshi);
|
|
|
|
+ $itemId = $yaoshiArr[0];
|
|
|
|
+ if (StlUtil::dictHasProperty(ctx()->store->items, $itemId) && ctx()->store->items[$itemId] >= $yaoshiArr[1]) {
|
|
|
|
+ ctx()->store->removeItem($itemId, $yaoshiArr[1]);
|
|
|
|
+ } else {
|
|
|
|
+ my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
|
|
|
|
+ $user->baseInfo->Consume_Cash($cost);
|
|
|
|
+ }
|
|
|
|
+ } elseif ($buyNum == 10) {
|
|
|
|
+ $cost = $mo->cost_ten;
|
|
|
|
+ my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
|
|
|
|
+ $user->baseInfo->Consume_Cash($cost);
|
|
|
|
+ }
|
|
|
|
|
|
$arr = array();
|
|
$arr = array();
|
|
$arr[] = 1;
|
|
$arr[] = 1;
|
|
@@ -275,11 +282,11 @@ class ShopProc {
|
|
|
|
|
|
$n = rand(0, count($gemList) - 1);
|
|
$n = rand(0, count($gemList) - 1);
|
|
$gem = StoreProc::initGem($gemList[$n]->typeId);
|
|
$gem = StoreProc::initGem($gemList[$n]->typeId);
|
|
-
|
|
|
|
- if($mo->type == 2){
|
|
|
|
|
|
+
|
|
|
|
+ if ($mo->type == 2) {
|
|
SystemProc::GetGem_GreaterOrangeQual_ShopBox(req()->zoneid, ctx()->baseInfo->name, $gemList[$n]->typeId);
|
|
SystemProc::GetGem_GreaterOrangeQual_ShopBox(req()->zoneid, ctx()->baseInfo->name, $gemList[$n]->typeId);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
$resultArr[] = $gem->uid;
|
|
$resultArr[] = $gem->uid;
|
|
StoreProc::PutGemInStore($gem);
|
|
StoreProc::PutGemInStore($gem);
|
|
}
|
|
}
|
|
@@ -456,7 +463,6 @@ class ShopProc {
|
|
$user->privateState->monthCardShop_ts = now();
|
|
$user->privateState->monthCardShop_ts = now();
|
|
StoreProc::AddMultiItemInStore($mo->buy_reward);
|
|
StoreProc::AddMultiItemInStore($mo->buy_reward);
|
|
EmailProc::SendMonthCardRewardMail(req()->zoneid, req()->uid, $mo->daily_reward);
|
|
EmailProc::SendMonthCardRewardMail(req()->zoneid, req()->uid, $mo->daily_reward);
|
|
-
|
|
|
|
} else {
|
|
} else {
|
|
my_Assert($user->privateState->honourCardShop_ts == 0, ErrCode::err_const_no);
|
|
my_Assert($user->privateState->honourCardShop_ts == 0, ErrCode::err_const_no);
|
|
$user->privateState->honourCardShop_ts = now();
|
|
$user->privateState->honourCardShop_ts = now();
|