From 968504744a47808217c4ed2f7888cac9bc816cda Mon Sep 17 00:00:00 2001 From: shengchanzhe <179998674@qq.com> Date: Mon, 25 Dec 2023 17:36:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/repositories/store/product/ProductRepository.php | 2 +- app/controller/merchant/store/product/ProductLabel.php | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index fa29b0a6..4e9a127f 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -2346,7 +2346,7 @@ class ProductRepository extends BaseRepository foreach ($data['attrValue'] as $k => $item) { //$data['attrValue'][$k]['stock'] = 0; } - app()->make(ProductLabelRepository::class)->checkHas($merId, $data['mer_labels']); + app()->make(ProductLabelRepository::class)->checkHas(0, $data['mer_labels']); $count = app()->make(StoreCategoryRepository::class)->getWhereCount(['store_category_id' => $data['cate_id'], 'is_show' => 1]); if (!$count) throw new ValidateException('平台分类不存在或不可用'); app()->make(StoreProductValidate::class)->check($data); diff --git a/app/controller/merchant/store/product/ProductLabel.php b/app/controller/merchant/store/product/ProductLabel.php index c1a5bf66..4aa28e59 100644 --- a/app/controller/merchant/store/product/ProductLabel.php +++ b/app/controller/merchant/store/product/ProductLabel.php @@ -62,8 +62,7 @@ class ProductLabel extends BaseController $data = $this->checkParams($validate); if (!$this->repository->check($data['label_name'], $this->request->merId(),$id)) return app('json')->fail('名称重复'); - //'mer_id' => $this->request->merId() - $getOne = $this->repository->getWhere(['product_label_id' => $id]); + $getOne = $this->repository->getWhere(['product_label_id' => $id,'mer_id' => $this->request->merId()]); if (!$getOne) return app('json')->fail('数据不存在'); $this->repository->update($id, $data); return app('json')->success('编辑成功');