feat : meal catering
This commit is contained in:
@@ -98,6 +98,8 @@ trait OrderTrait
|
||||
/**
|
||||
* 检测商品
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
protected function checkGood(): void
|
||||
{
|
||||
@@ -106,6 +108,10 @@ trait OrderTrait
|
||||
|
||||
if ($this->orderType == 0) $this->orderType = $this->skuArr[$key]['type'];
|
||||
if ($this->skuArr[$key]['type'] != $this->orderType) throw new ErrException('自选菜品跟套餐菜品请分开订单下单');
|
||||
|
||||
if ($this->orderType != OrderCode::ORDER_TYPE_MEAL) return;
|
||||
|
||||
if ($this->isMealCateringByCache($this->siteId, $key, $this->cycleId)) throw new ErrException('该点位的套餐'.$this->skuArr[$key]['title'].'已配餐截单,请选择其他套餐');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,7 +160,7 @@ trait OrderTrait
|
||||
|
||||
$closeOrderFlag = match ($this->orderType) {
|
||||
OrderCode::ORDER_TYPE_OPTIONAL => $this->checkIsStopOrder($siteId, $this->cycleId),
|
||||
OrderCode::ORDER_TYPE_MEAL => false, //todo 这里逻辑补全
|
||||
OrderCode::ORDER_TYPE_MEAL => $this->checkMealIsStopOrder($siteId, $this->cycleId),
|
||||
};
|
||||
|
||||
if ($closeOrderFlag) throw new ErrException('该点已经截单');
|
||||
|
||||
Reference in New Issue
Block a user