feat : ide config

This commit is contained in:
2025-03-17 17:29:51 +08:00
parent 4758aa598d
commit 9e22529161
14 changed files with 259 additions and 52 deletions

View File

@@ -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);
}