duhongyu 5 vuotta sitten
vanhempi
commit
486069db68

+ 12 - 4
代码/TVShoppingCallCenter_ZLJ/Controllers/Product/ProductClassController.cs

@@ -85,10 +85,14 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
85 85
             {
86 86
                 return Error("分类简写重复");
87 87
             }
88
-            if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId&&b.F_Lock==1) > 0)
88
+            if (input .ParentId>0)
89 89
             {
90
-                return Error("系统锁定分类不允许设置子类");
90
+                if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId && b.F_Lock == 1) > 0)
91
+                {
92
+                    return Error("系统锁定分类不允许设置子类");
93
+                }
91 94
             }
95
+           
92 96
 
93 97
 
94 98
             T_Bus_ProductClass T_Bus_ProductClassModel = new T_Bus_ProductClass();
@@ -142,9 +146,13 @@ namespace TVShoppingCallCenter_ZLJ.Controllers.Product
142 146
             {
143 147
                 return Error("分类简写重复");
144 148
             }
145
-            if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId && b.F_Lock == 1) > 0)
149
+            if (input.ParentId>0)
146 150
             {
147
-                return Error("系统锁定分类不允许设置子类");
151
+                if (await _productClassRepository.GetCount(b => b.F_ParentId == input.ParentId && b.F_Lock == 1
152
+             ) > 0)
153
+                {
154
+                    return Error("系统锁定分类不允许设置子类");
155
+                }
148 156
             }
149 157
 
150 158
             T_Bus_ProductClass T_Bus_ProductClassModel = await _productClassRepository.GetSingle(a => a.F_ClassId == input.ClassId);