1
This commit is contained in:
parent
98c38f44e3
commit
59c18b3544
@ -71,11 +71,19 @@ class ShopController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$goodsMeta = mt\ShopGoods::get($id);
|
$goodsMeta = mt\ShopGoods::get($id);
|
||||||
|
|
||||||
if (!$goodsMeta) {
|
if (!$goodsMeta) {
|
||||||
$this->_rspErr(1, 'goods not found');
|
$this->_rspErr(1, 'goods not found');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if ($goodsNum > $goodsMeta['max_amount']) {
|
||||||
|
$this->_rspErr(1, "goods_num parameter error, max_amount: {$goodsMeta['max_amount']}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$itemMeta = mt\Item::get($goodsMeta['goods_id']);
|
||||||
|
if (!$itemMeta) {
|
||||||
|
$this->_rspErr(1, 'goods not found, goods_id: ' . $goodsMeta['goods_id']);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$goodsId = $goodsMeta['goods_id'];
|
$goodsId = $goodsMeta['goods_id'];
|
||||||
|
|
||||||
@ -96,23 +104,12 @@ class ShopController extends BaseAuthedController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($goodsNum > $goodsMeta['max_amount']) {
|
|
||||||
$this->_rspErr(1, "goods_num parameter error, max_amount: {$goodsMeta['max_amount']}");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 这里命名混乱了, 购买个数,一捆个数命名冲突
|
// 这里命名混乱了, 购买个数,一捆个数命名冲突
|
||||||
$goods_count = $goodsMeta['goods_num'];
|
$goods_count = $goodsMeta['goods_num'];
|
||||||
|
|
||||||
$buyRecordHash = ShopBuyRecord::allToHash();
|
$buyRecordHash = ShopBuyRecord::allToHash();
|
||||||
$boughtTimes = 1;
|
$boughtTimes = 1;
|
||||||
|
|
||||||
$itemMeta = mt\Item::get($goodsMeta['goods_id']);
|
|
||||||
if (!$itemMeta) {
|
|
||||||
$this->_rspErr(1, 'goods not found, goods_id: ' . $goodsMeta['goods_id']);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($itemMeta['type'] == mt\Item::HERO_SKIN_TYPE) {
|
if ($itemMeta['type'] == mt\Item::HERO_SKIN_TYPE) {
|
||||||
$errCode = 0;
|
$errCode = 0;
|
||||||
$errMsg = '';
|
$errMsg = '';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user