From 9b2b25c5919203f1b95a1f0d2a5e116c4de112be Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 10 Oct 2024 16:13:39 +0800 Subject: [PATCH] 1 --- webapp/services/HashRateShopService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/webapp/services/HashRateShopService.php b/webapp/services/HashRateShopService.php index 97fdf8bd..beaf950a 100644 --- a/webapp/services/HashRateShopService.php +++ b/webapp/services/HashRateShopService.php @@ -58,6 +58,11 @@ class HashRateShopService { public static function buyLimitCheck($goodsMeta, $goodsNum, &$errCode, &$errMsg) { + if ($goodsMeta['is_close']) { + $errCode = 1; + $errMsg = 'cant buy'; + return; + } $errCode = 0; $errMsg = ''; $buyRecordHash = ShopBuyRecord::allToHash(); @@ -90,7 +95,7 @@ class HashRateShopService { $boughtTimes = $buyRecord ? $buyRecord['this_month_buy_times'] + $goodsNum : 1; if ($buyRecord && getXVal($buyRecord, 'this_month_buy_times', 0) >= $goodsMeta['limit_num']) { $errCode = 2; - $errMsg = 'month purchase limit reached'; + $errMsg = 'Month purchase limit reached'; return false; } }