feat : ide config
This commit is contained in:
@@ -102,11 +102,10 @@ trait OrderTrait
|
||||
protected function checkGood(): void
|
||||
{
|
||||
foreach ($this->cartFirstData as $key => $one) {
|
||||
if (!in_array($key, $this->goodIds)) throw new ErrException('商品不存在',ApiCode::ORDER_GOOD_IN_EXISTENCE);
|
||||
|
||||
if ($this->orderType == 0) $this->orderType = $this->skuArr[$key]['type'];
|
||||
if ($this->skuArr[$key]['type'] != $this->orderType) throw new ErrException('自选菜品跟套餐菜品请分开订单下单');
|
||||
|
||||
if (in_array($key, $this->goodIds)) continue;
|
||||
throw new ErrException('商品不存在',ApiCode::ORDER_GOOD_IN_EXISTENCE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -206,6 +205,7 @@ trait OrderTrait
|
||||
$this->skuArr = array_column($skuArr,null,'id');
|
||||
$this->skuImageArr = array_column($skuArr,null,'id');
|
||||
$this->goodIds = array_column($skuArr,'id');
|
||||
|
||||
unset($skuArr);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user