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('该厨房已禁用');