浏览代码

分类列表追加全部

lizhen_gitee 1 年之前
父节点
当前提交
6978da6c0c
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      addons/unishop/controller/Product.php

+ 11 - 1
addons/unishop/controller/Product.php

@@ -191,8 +191,18 @@ class Product extends Base
 
     //分类列表
     public function cate_list(){
+        $all = [
+            0=>[
+                'id' => 0,
+                'cate_name' => '全部',
+                'cate_info' => '全部',
+            ]
+        ];
+
         $list = Db::name('unishop_cate')->order('id asc')->select();
-        $this->success(1,$list);
+
+        $result = array_merge($all,$list);
+        $this->success(1,$result);
     }