feat : add_staple_food
This commit is contained in:
@@ -124,6 +124,18 @@ trait OrderTrait
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
protected function checkTodayCutOffTime(): void
|
||||
{
|
||||
$todayCutOffTime = $this->configCache->getConfigValue(ConfigCode::TODAY_CUT_OFF_TIME_KEY);
|
||||
|
||||
if (date('H:i:s') >= $todayCutOffTime) throw new ErrException('平台已全部截止下单哦');
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测地点
|
||||
* @param int $siteId
|
||||
@@ -139,6 +151,13 @@ trait OrderTrait
|
||||
$kitchenId = (int)($siteInfo['kitchen_id'] ?? 0);
|
||||
if ($kitchenId <= 0) throw new ErrException('该地点暂时不支持点餐');
|
||||
|
||||
$closeOrderFlag = match ($this->orderType) {
|
||||
OrderCode::ORDER_TYPE_OPTIONAL => $this->checkIsStopOrder($siteId, $this->cycleId),
|
||||
OrderCode::ORDER_TYPE_MEAL => true,
|
||||
};
|
||||
|
||||
if ($closeOrderFlag) throw new ErrException('该点已经截单');
|
||||
|
||||
$this->orderRes['site_id'] = $siteId;
|
||||
$this->orderRes['site_info'] = $siteInfo;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user