shish 4 éve
szülő
commit
4f3ab1b9d9

+ 5 - 5
app-ghs/controllers/CategoryController.php

@@ -30,7 +30,7 @@ class CategoryController extends BaseController
     {
         $id = Yii::$app->request->get('categoryId', 0);
         $category = CategoryService::getById($id);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         $info = CategoryService::getInfo($id);
         util::success($info);
     }
@@ -50,7 +50,7 @@ class CategoryController extends BaseController
         $post = Yii::$app->request->post();
         $categoryId = isset($post['categoryId']) ? $post['categoryId'] : 0;
         $category = CategoryService::getById($categoryId);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         CategoryService::updateCategory($category, $post);
         util::complete('修改成功');
     }
@@ -62,7 +62,7 @@ class CategoryController extends BaseController
         $categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
         $status = isset($get['status']) ? $get['status'] : 0;
         $category = CategoryService::getById($categoryId);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         CategoryService::changeStatus($categoryId, $status);
         util::complete();
     }
@@ -73,7 +73,7 @@ class CategoryController extends BaseController
         $get = Yii::$app->request->get();
         $categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
         $category = CategoryService::getById($categoryId);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         CategoryService::deleteCategory($categoryId);
         util::complete('删除成功');
     }
@@ -98,7 +98,7 @@ class CategoryController extends BaseController
         $id = Yii::$app->request->get('id', 0);
         $inTurn = Yii::$app->request->get('inTurn', 0);
         $category = CategoryService::getById($id);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         CategoryService::updateById($id, ['inTurn' => $inTurn]);
         util::complete();
     }

+ 1 - 1
app-ghs/controllers/GoodsController.php

@@ -88,7 +88,7 @@ class GoodsController extends BaseController
         if ($cId != 0) {
             //验证分类
             $category = CategoryService::getById($cId);
-            CategoryService::valid($category, $this->sjId);
+            CategoryService::valid($category, $this->mainId);
             GoodsCategoryService::updateByCondition(['cId' => $cId, 'gId' => $id], ['inTurn' => $inTurn]);
         } else {
             GoodsService::updateById($id, ['inTurn' => $inTurn]);

+ 6 - 6
app-hd/controllers/CategoryController.php

@@ -24,7 +24,7 @@ class CategoryController extends BaseController
     {
         $id = Yii::$app->request->get('categoryId', 0);
         $category = CategoryService::getById($id);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         $info = CategoryService::getInfo($id);
         util::success($info);
     }
@@ -39,13 +39,13 @@ class CategoryController extends BaseController
         util::success(['id' => $cat['id']]);
     }
 
-    //更新分类 ssh 2019.12.8
+    //更新分类 ssh 20220404
     public function actionUpdate()
     {
         $post = Yii::$app->request->post();
         $categoryId = isset($post['categoryId']) ? $post['categoryId'] : 0;
         $category = CategoryService::getById($categoryId);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         CategoryService::updateCategory($category, $post);
         util::complete('修改成功');
     }
@@ -57,7 +57,7 @@ class CategoryController extends BaseController
         $categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
         $status = isset($get['status']) ? $get['status'] : 0;
         $category = CategoryService::getById($categoryId);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         CategoryService::changeStatus($categoryId, $status);
         util::complete();
     }
@@ -68,7 +68,7 @@ class CategoryController extends BaseController
         $get = Yii::$app->request->get();
         $categoryId = isset($get['categoryId']) ? $get['categoryId'] : 0;
         $category = CategoryService::getById($categoryId);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         if ($category['goodsNum'] > 0) {
             util::fail('分类下还有商品');
         }
@@ -109,7 +109,7 @@ class CategoryController extends BaseController
         $id = Yii::$app->request->get('id', 0);
         $inTurn = Yii::$app->request->get('inTurn', 0);
         $category = CategoryService::getById($id);
-        CategoryService::valid($category, $this->sjId);
+        CategoryService::valid($category, $this->mainId);
         CategoryService::updateById($id, ['inTurn' => $inTurn]);
         util::complete();
     }

+ 1 - 1
app-hd/controllers/GoodsController.php

@@ -79,7 +79,7 @@ class GoodsController extends BaseController
         if ($cId != 0) {
             //验证分类
             $category = CategoryService::getById($cId);
-            CategoryService::valid($category, $this->sjId);
+            CategoryService::valid($category, $this->mainId);
             GoodsCategoryService::updateByCondition(['cId' => $cId, 'gId' => $id], ['inTurn' => $inTurn]);
         } else {
             GoodsService::updateById($id, ['inTurn' => $inTurn]);