|
@@ -85,15 +85,15 @@ class GoodsCategoryValidate extends BaseValidate
|
|
|
*/
|
|
*/
|
|
|
public function checkName($value,$rule,$data)
|
|
public function checkName($value,$rule,$data)
|
|
|
{
|
|
{
|
|
|
- $where[] = ['name', '=', $value];
|
|
|
|
|
- // 编辑的情况,要排除自身ID
|
|
|
|
|
- if (isset($data['id'])) {
|
|
|
|
|
- $where[] = ['id', '<>', $data['id']];
|
|
|
|
|
- }
|
|
|
|
|
- $result = GoodsCategory::where($where)->select()->toArray();
|
|
|
|
|
- if ($result) {
|
|
|
|
|
- return '该商品分类名称已存在';
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// $where[] = ['name', '=', $value];
|
|
|
|
|
+// // 编辑的情况,要排除自身ID
|
|
|
|
|
+// if (isset($data['id'])) {
|
|
|
|
|
+// $where[] = ['id', '<>', $data['id']];
|
|
|
|
|
+// }
|
|
|
|
|
+// $result = GoodsCategory::where($where)->select()->toArray();
|
|
|
|
|
+// if ($result) {
|
|
|
|
|
+// return '该商品分类名称已存在';
|
|
|
|
|
+// }
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|