From 73b874c72ad55eb9eef21c36160ac0de58f0189e Mon Sep 17 00:00:00 2001
From: quanwei <419654421@qq.com>
Date: Thu, 05 Feb 2026 10:30:43 +0800
Subject: [PATCH] 优化名片
---
admin/app/shop/model/supplier/Category.php | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/admin/app/shop/model/supplier/Category.php b/admin/app/shop/model/supplier/Category.php
index 87996a5..c9e873b 100644
--- a/admin/app/shop/model/supplier/Category.php
+++ b/admin/app/shop/model/supplier/Category.php
@@ -24,7 +24,7 @@
public function add($data)
{
$data['app_id'] = self::$app_id;
- $isExist = static::where('name','=',$data['name'])->find();
+ $isExist = static::where('name','=',$data['name'])->where('category_type','=',$data['category_type'])->find();
if($isExist){
$this->error='名称已存在';
return false;
@@ -37,7 +37,7 @@
*/
public function edit($data)
{
- $isExist = static::where('name','=',$data['name'])->where('category_id','<>',$data['category_id'])->find();
+ $isExist = static::where('name','=',$data['name'])->where('category_type','=',$data['category_type'])->where('category_id','<>',$data['category_id'])->find();
if($isExist){
$this->error='名称已存在';
return false;
--
Gitblit v1.9.2