This commit is contained in:
shengchanzhe 2023-12-25 17:36:07 +08:00
parent 0336d6a59b
commit 968504744a
2 changed files with 2 additions and 3 deletions

View File

@ -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);

View File

@ -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('编辑成功');