shish 3 年之前
父節點
當前提交
28087d8eb1
共有 2 個文件被更改,包括 12 次插入3 次删除
  1. 6 3
      app-mall/controllers/CategoryController.php
  2. 6 0
      biz-mall/goods/services/CategoryService.php

+ 6 - 3
app-mall/controllers/CategoryController.php

@@ -16,10 +16,13 @@ class CategoryController extends BaseController
     //获取分类 ssh 2019.12.2
     public function actionList()
     {
-
+        //建立客户关系
         CustomClass::buildRelation($this->shop, $this->user);
-
-        $return = CategoryService::getEnableList($this->mainId);
+        $mainId = $this->mainId ?? 0;
+        $where = ['mainId' => $mainId, 'delStatus' => 0, 'status' => 1];
+        //默认列出正常分类,美团等第三方分类不列表
+        $where['style'] = 0;
+        $return = CategoryService::getAllList($where);
         util::success($return);
     }
 

+ 6 - 0
biz-mall/goods/services/CategoryService.php

@@ -29,6 +29,12 @@ class CategoryService extends BaseService
         return $cat;
     }
 
+    public static function getAllList($where)
+    {
+        $cat = CategoryClass::getAllByCondition($where, 'inTurn DESC', '*');
+        return $cat;
+    }
+
     //取出可用的分类 ssh 2019.12.2
     public static function getEnableList($mainId)
     {