feat : check

This commit is contained in:
2025-04-02 15:59:38 +08:00
parent 3f3aab3d45
commit 4620a0f1ba

View File

@@ -66,7 +66,7 @@ class CompleteListService extends CateringBaseService
if (!$this->isBuildPickupCode() || !$this->isCateringByCache() || !$this->checkIsPrint()) throw new ErrException('先执行整线路配餐后才可以获取已配餐信息'); if (!$this->isBuildPickupCode() || !$this->isCateringByCache() || !$this->checkIsPrint()) throw new ErrException('先执行整线路配餐后才可以获取已配餐信息');
if ($this->logInfo->quantity <= 0) throw new ErrException('该点无任何配餐数据'); if ($this->logInfo->quantity <= 0) throw new ErrException('该点无任何配餐数据-01');
$siteInfo = $this->siteModel->getInfoById($this->logInfo->site_id); $siteInfo = $this->siteModel->getInfoById($this->logInfo->site_id);
if (empty($siteInfo)) throw new ErrException('配餐地址不存在,请确认信息'); if (empty($siteInfo)) throw new ErrException('配餐地址不存在,请确认信息');
@@ -78,11 +78,11 @@ class CompleteListService extends CateringBaseService
->where('site_id', $siteInfo->id) ->where('site_id', $siteInfo->id)
->where('cycle_id', $this->cycleId) ->where('cycle_id', $this->cycleId)
->where('type',OrderCode::ORDER_TYPE_OPTIONAL) ->where('type',OrderCode::ORDER_TYPE_OPTIONAL)
->where('status',OrderCode::PAYED) ->where('status',OrderCode::PLAN)
->orderBy('id') ->orderBy('id')
->pluck('id') ->pluck('id')
->toArray(); ->toArray();
if (empty($orderIds)) throw new ErrException('该点无任何配餐数据'); if (empty($orderIds)) throw new ErrException('该点无任何配餐数据-02');
$pickUpCodeList = $this->pickupCodeModel->whereIn('order_id',$orderIds)->select(['pickup_code','order_id','copies','id'])->get(); $pickUpCodeList = $this->pickupCodeModel->whereIn('order_id',$orderIds)->select(['pickup_code','order_id','copies','id'])->get();
if ($pickUpCodeList->isEmpty()) throw new ErrException('该点未生成取餐码'); if ($pickUpCodeList->isEmpty()) throw new ErrException('该点未生成取餐码');