From 35e5bb80b2a47744b01a70cda77b128f3a07d324 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Wed, 9 Apr 2025 15:10:07 +0800 Subject: [PATCH] feat : rank --- app/Service/Admin/Catering/Meal/CateringService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Service/Admin/Catering/Meal/CateringService.php b/app/Service/Admin/Catering/Meal/CateringService.php index 11d58a4..7be3f3c 100644 --- a/app/Service/Admin/Catering/Meal/CateringService.php +++ b/app/Service/Admin/Catering/Meal/CateringService.php @@ -77,7 +77,6 @@ class CateringService extends CateringBaseService // 获取数据源 $this->logInfo = $this->orderMealCateringLogModel->find($id); $this->siteInfo = $this->siteModel->find($this->logInfo->site_id); - $this->resCount = $this->logInfo->quantity; // 检测数据 $this->check(); @@ -138,6 +137,8 @@ class CateringService extends CateringBaseService if ($this->logInfo->quantity <= 0) throw new ErrException('该配餐数量为0,不可配餐'); + $this->resCount = $this->logInfo->quantity; + $allOrderIds = $this->orderModel ->where('site_id', $this->logInfo->site_id) ->where('cycle_id', $this->cycleId) @@ -152,6 +153,6 @@ class CateringService extends CateringBaseService ->where('sku_id', $this->logInfo->sku_id) ->sum('copies') ?? 0; - if ($totalCopies != $this->logInfo->quantity) $this->resCount = $totalCopies; + if ($totalCopies != $this->logInfo->quantity) $this->resCount = (int)$totalCopies; } } \ No newline at end of file