diff --git a/webapp/mt/Item.php b/webapp/mt/Item.php index 21e57952..7462ae68 100644 --- a/webapp/mt/Item.php +++ b/webapp/mt/Item.php @@ -106,10 +106,6 @@ class Item { const DRUG_TILI_SUBTYPE = 4; const DRUG_DURABILITY_SUBTYPE = 5; - const DAILY_BUY_LIMIT = 1; - const WEEKLY_BUY_LIMIT = 2; - const TOTAL_BUY_LIMIT = 3; - const ROLE_CHIP_SUBTYPE = 1; const GUN_CHIP_SUBTYPE = 2; diff --git a/webapp/services/ShopService.php b/webapp/services/ShopService.php index c5b4518b..7b309d60 100644 --- a/webapp/services/ShopService.php +++ b/webapp/services/ShopService.php @@ -4,6 +4,7 @@ namespace services; require_once('mt/ShopGoods.php'); require_once('mt/Item.php'); +require_once('mt/Shop.php'); require_once('models/ShopBuyRecord.php'); require_once('models/Hero.php'); @@ -43,17 +44,17 @@ class ShopService { ); array_push($goodsList, $goodsDto); switch ($goodsMeta['limit_type']) { - case mt\Item::DAILY_BUY_LIMIT: { + case mt\Shop::DAILY_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']); $goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_day_buy_times'] : 0; } break; - case mt\Item::WEEKLY_BUY_LIMIT: { + case mt\Shop::WEEKLY_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']); $goodsDto['bought_times'] = $buyRecord ? $buyRecord['this_week_buy_times'] : 0; } break; - case mt\Item::TOTAL_BUY_LIMIT: { + case mt\Shop::TOTAL_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $goodsMeta['goods_id']); $goodsDto['bought_times'] = $buyRecord ? $buyRecord['total_buy_times'] : 0; } @@ -90,7 +91,7 @@ class ShopService { $boughtTimes = 1; { switch ($goodsMeta['limit_type']) { - case ShopController::DAILY_BUY_LIMIT: { + case mt\Shop::DAILY_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $id); $boughtTimes = $buyRecord ? $buyRecord['this_day_buy_times'] + 1 : 1; if ($buyRecord && getXVal($buyRecord, 'this_day_buy_times', 0) >= $goodsMeta['limit_num']) { @@ -99,7 +100,7 @@ class ShopService { } } break; - case ShopController::WEEKLY_BUY_LIMIT: { + case mt\Shop::WEEKLY_BUY_LIMIT: { $buyRecord = getXVal($buyRecordHash, $id); $boughtTimes = $buyRecord ? $buyRecord['this_week_buy_times'] + 1 : 1; if ($buyRecord && getXVal($buyRecord, 'this_week_buy_times', 0) >= $goodsMeta['limit_num']) { @@ -108,7 +109,7 @@ class ShopService { } } break; - case ShopController::TOTAL_BUY_LIMIT: { + case mt\Shop::TOTAL_BUY_LIMIT: { // error_log("total buy limit " . $address . " " . $id . " " . $goodsMeta['limit_num']); $buyRecord = getXVal($buyRecordHash, $id); $boughtTimes = $buyRecord ? $buyRecord['total_buy_times'] + 1 : 1;