diff --git a/app/api/controller/goods/GoodsclassController.php b/app/api/controller/cate/CateController.php similarity index 60% rename from app/api/controller/goods/GoodsclassController.php rename to app/api/controller/cate/CateController.php index 51b8af4e3..b0ae89807 100644 --- a/app/api/controller/goods/GoodsclassController.php +++ b/app/api/controller/cate/CateController.php @@ -1,17 +1,17 @@ dataLists(new GoodsclassLists()); + return $this->dataLists(new CateLists()); } diff --git a/app/api/lists/goods/GoodsclassLists.php b/app/api/lists/cate/CateLists.php similarity index 86% rename from app/api/lists/goods/GoodsclassLists.php rename to app/api/lists/cate/CateLists.php index d2c84d36e..8d2b74a0d 100644 --- a/app/api/lists/goods/GoodsclassLists.php +++ b/app/api/lists/cate/CateLists.php @@ -1,10 +1,10 @@ get('pid',0); if($pid==0){ - $lists = Goodsclass::where($this->searchWhere) + $lists = Cate::where($this->searchWhere) ->where('pid', 0) ->where('children','<>',null) ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) @@ -57,7 +57,7 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface $where[]=['children','<>','']; $this->where=$where; } - $lists = Goodsclass::where($this->searchWhere) + $lists = Cate::where($this->searchWhere) ->where($this->where) ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) ->limit($this->limitOffset, $this->limitLength) @@ -72,6 +72,7 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface // $v['children'] = $b; // } // })->toArray(); + return $lists; // return linear_to_tree($lists, 'children'); @@ -88,11 +89,11 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface { $pid=Request()->get('pid',0); if($pid==0){ - return Goodsclass::where($this->searchWhere)->where('pid', 0) + return Cate::where($this->searchWhere)->where('pid', 0) ->where('children','<>',null) ->count(); }else{ - return Goodsclass::where($this->searchWhere) + return Cate::where($this->searchWhere) ->where($this->where) ->count(); } diff --git a/app/common/model/goods/Goodsclass.php b/app/common/model/cate/Cate.php similarity index 86% rename from app/common/model/goods/Goodsclass.php rename to app/common/model/cate/Cate.php index 271298308..cb2506c7e 100644 --- a/app/common/model/goods/Goodsclass.php +++ b/app/common/model/cate/Cate.php @@ -1,6 +1,6 @@