From 817effdc66dd41090fc5cf1308d2decb39a49577 Mon Sep 17 00:00:00 2001 From: ctexthuang Date: Tue, 14 Jan 2025 15:26:40 +0800 Subject: [PATCH] feat: chef --- app/Service/Admin/Good/SpuService.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Service/Admin/Good/SpuService.php b/app/Service/Admin/Good/SpuService.php index d6dd67f..c6e5004 100644 --- a/app/Service/Admin/Good/SpuService.php +++ b/app/Service/Admin/Good/SpuService.php @@ -133,11 +133,12 @@ class SpuService extends BaseService $title = $this->request->input('title'); + $this->checkInfo(); + $info = $this->spuModel->getInfoByCityIdAndCycleId($this->cityId, $cycleInfo->id,$title); if (!empty($info)) throw new ErrException('该菜品在当前城市已存在'); - $this->checkInfo(); $insertModel = new Spu(); @@ -181,7 +182,7 @@ class SpuService extends BaseService { $kitchenId = $this->request->input('kitchen_id'); $kitchenInfo = $this->kitchenModel->getInfoById($kitchenId); - $this->cityId = $kitchenInfo->city_id; + $this->cityId = (int)$kitchenInfo->city_id; if ($kitchenInfo->status == SiteCode::KITCHEN_DISABLE) throw new ErrException('该厨房已禁用');