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