This commit is contained in:
aozhiwei 2024-10-10 16:13:39 +08:00
parent 0a4b16c84e
commit 9b2b25c591

View File

@ -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;
}
}