1
This commit is contained in:
parent
0a4b16c84e
commit
9b2b25c591
@ -58,6 +58,11 @@ class HashRateShopService {
|
|||||||
|
|
||||||
public static function buyLimitCheck($goodsMeta, $goodsNum, &$errCode, &$errMsg)
|
public static function buyLimitCheck($goodsMeta, $goodsNum, &$errCode, &$errMsg)
|
||||||
{
|
{
|
||||||
|
if ($goodsMeta['is_close']) {
|
||||||
|
$errCode = 1;
|
||||||
|
$errMsg = 'cant buy';
|
||||||
|
return;
|
||||||
|
}
|
||||||
$errCode = 0;
|
$errCode = 0;
|
||||||
$errMsg = '';
|
$errMsg = '';
|
||||||
$buyRecordHash = ShopBuyRecord::allToHash();
|
$buyRecordHash = ShopBuyRecord::allToHash();
|
||||||
@ -90,7 +95,7 @@ class HashRateShopService {
|
|||||||
$boughtTimes = $buyRecord ? $buyRecord['this_month_buy_times'] + $goodsNum : 1;
|
$boughtTimes = $buyRecord ? $buyRecord['this_month_buy_times'] + $goodsNum : 1;
|
||||||
if ($buyRecord && getXVal($buyRecord, 'this_month_buy_times', 0) >= $goodsMeta['limit_num']) {
|
if ($buyRecord && getXVal($buyRecord, 'this_month_buy_times', 0) >= $goodsMeta['limit_num']) {
|
||||||
$errCode = 2;
|
$errCode = 2;
|
||||||
$errMsg = 'month purchase limit reached';
|
$errMsg = 'Month purchase limit reached';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user