|
@@ -78,7 +78,7 @@ class ShopProc {
|
|
//$resultArr = array();
|
|
//$resultArr = array();
|
|
switch ($type) {
|
|
switch ($type) {
|
|
case EnumShopGift::GateGift_Shop://章节礼包
|
|
case EnumShopGift::GateGift_Shop://章节礼包
|
|
- $gateGift = self::BuyShop_GateGift($type, $typeId, $buyNum);
|
|
|
|
|
|
+ self::BuyShop_GateGift($type, $typeId, $buyNum);
|
|
break;
|
|
break;
|
|
case EnumShopGift::Daily_Shop://每日商店
|
|
case EnumShopGift::Daily_Shop://每日商店
|
|
self::BuyShop_Daily($type, $typeId, $buyNum);
|
|
self::BuyShop_Daily($type, $typeId, $buyNum);
|
|
@@ -132,39 +132,39 @@ class ShopProc {
|
|
*/
|
|
*/
|
|
|
|
|
|
public static function BuyShop_GateGift($type, $typeId, $buyNum) {
|
|
public static function BuyShop_GateGift($type, $typeId, $buyNum) {
|
|
- $gateGift = array();
|
|
|
|
|
|
+ //$gateGift = array();
|
|
my_Assert(!in_array($typeId, ctx()->privateState->gateGiftReceived), ErrCode::user_shop_NotRepeatBuy);
|
|
my_Assert(!in_array($typeId, ctx()->privateState->gateGiftReceived), ErrCode::user_shop_NotRepeatBuy);
|
|
|
|
|
|
$mo = GameConfig::shop_gategift_getItem($typeId);
|
|
$mo = GameConfig::shop_gategift_getItem($typeId);
|
|
my_Assert($mo != null, ErrCode::err_const_no);
|
|
my_Assert($mo != null, ErrCode::err_const_no);
|
|
|
|
+ StoreProc::AddMultiItemInStore($mo->reward);
|
|
|
|
+// $price = explode(';', $mo->reward);
|
|
|
|
+// foreach ($price as $value) {
|
|
|
|
+// $item = explode(',', $value);
|
|
|
|
+// if (GameConfig::item_getItem($item[0])->itemType == EnumItemType::tuzhiBox) {
|
|
|
|
+// $dic = GameConfig::item();
|
|
|
|
+// $list = array();
|
|
|
|
+// foreach ($dic as $id => $val) {
|
|
|
|
+// if ($val->itemType == EnumItemType::tuzhi) {
|
|
|
|
+// $list[] = $val->typeId;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
+//
|
|
|
|
+// $randNum = rand(0, count($list) - 1);
|
|
|
|
+// $tuzhiId = $list[$randNum];
|
|
|
|
+// $gateGift[] = $tuzhiId . ',1';
|
|
|
|
+// } else {
|
|
|
|
+// $gateGift[] = $value;
|
|
|
|
+// }
|
|
|
|
+// }
|
|
|
|
|
|
- $price = explode(';', $mo->reward);
|
|
|
|
- foreach ($price as $value) {
|
|
|
|
- $item = explode(',', $value);
|
|
|
|
- if (GameConfig::item_getItem($item[0])->itemType == EnumItemType::tuzhiBox) {
|
|
|
|
- $dic = GameConfig::item();
|
|
|
|
- $list = array();
|
|
|
|
- foreach ($dic as $id => $val) {
|
|
|
|
- if ($val->itemType == EnumItemType::tuzhi) {
|
|
|
|
- $list[] = $val->typeId;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- $randNum = rand(0, count($list) - 1);
|
|
|
|
- $tuzhiId = $list[$randNum];
|
|
|
|
- $gateGift[] = $tuzhiId . ',1';
|
|
|
|
- } else {
|
|
|
|
- $gateGift[] = $value;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- foreach ($gateGift as $str) {
|
|
|
|
- StoreProc::AddMultiItemInStore($str);
|
|
|
|
- }
|
|
|
|
|
|
+// foreach ($gateGift as $str) {
|
|
|
|
+// StoreProc::AddMultiItemInStore($str);
|
|
|
|
+// }
|
|
ctx()->privateState->gateGiftReceived[] = $typeId;
|
|
ctx()->privateState->gateGiftReceived[] = $typeId;
|
|
- ctx()->baseInfo->charge_amt += $mo->curPrice;
|
|
|
|
-
|
|
|
|
- return $gateGift;
|
|
|
|
|
|
+ ctx()->baseInfo->Consume_Cash($mo->price);
|
|
|
|
+
|
|
|
|
+ //return $gateGift;
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|