This commit is contained in:
azw 2023-07-30 09:12:49 +08:00
parent 4c195789ae
commit 5f31bcd84d

View File

@ -70,7 +70,7 @@ class ShopController extends BaseAuthedController {
return; return;
} }
$goodsMeta = mt\ShopGoods::getByGoodsUuid($id); $goodsMeta = mt\ShopGoods::getByGoodsUuid($goodsUuid);
if (!$goodsMeta) { if (!$goodsMeta) {
$this->_rspErr(1, 'goods not found'); $this->_rspErr(1, 'goods not found');
return; return;
@ -97,9 +97,9 @@ class ShopController extends BaseAuthedController {
return; return;
} }
$desired_token_type = $goodsMeta['token_type']; $desiredTokenType = $goodsMeta['token_type'];
$check_token_type = splitStr1($desired_token_type); $checkTokenType = splitStr1($desiredTokenType);
$token_pos = array_search($tokenType, $check_token_type, true); $tokenPos = array_search($tokenType, $checkTokenType, true);
$isFreeBuy = false; $isFreeBuy = false;
if (!empty($goodsMeta['free_type'])) { if (!empty($goodsMeta['free_type'])) {
$count = $this->countFreeBuyTimes($goodsMeta['free_type'], $goodsMeta['id'], $goodsMeta['goods_id']); $count = $this->countFreeBuyTimes($goodsMeta['free_type'], $goodsMeta['id'], $goodsMeta['goods_id']);
@ -108,8 +108,8 @@ class ShopController extends BaseAuthedController {
} }
} }
if (!$isFreeBuy) { if (!$isFreeBuy) {
if (!in_array($tokenType, $check_token_type)) { if (!in_array($tokenType, $checkTokenType)) {
$this->_rspErr(1, "token_type parameter error, desired_token_type: {$desired_token_type}"); $this->_rspErr(1, "token_type parameter error, desired_token_type: {$desiredTokenType}");
return; return;
} }
} }