This commit is contained in:
azw 2023-07-29 19:12:40 +08:00
parent d2069c3e76
commit e6a6b90fa5
2 changed files with 9 additions and 3 deletions

View File

@ -84,14 +84,18 @@ class ShopController extends BaseAuthedController {
$this->_rspErr(1, 'goods not found, goods_id: ' . $goodsMeta['goods_id']);
return;
}
$errCode = 0;
$errMsg = '';
if ($itemMeta['type'] == mt\Item::HERO_SKIN_TYPE) {
$errCode = 0;
$errMsg = '';
if (!$this->canBuy($itemMeta, $errCode, $errMsg)) {
$this->_rspErr($errCode, $errMsg);
return;
}
}
if (!ShopService::buyLimitCheck($goodsMeta, $errCode, $errMsg)) {
$this->_rspErr($errCode, $errMsg);
return;
}
$goodsId = $goodsMeta['goods_id'];

View File

@ -102,8 +102,10 @@ class ShopService {
return 0;
}
public static function buyLimitCheck($goodsMeta)
public static function buyLimitCheck($goodsMeta, &$errCode, &$errMsg)
{
$errCode = 0;
$errMsg = '';
$buyRecordHash = ShopBuyRecord::allToHash();
$boughtTimes = 1;
{