Explorar el Código

分类列表追加全部

lizhen_gitee hace 1 año
padre
commit
6978da6c0c
Se han modificado 1 ficheros con 11 adiciones y 1 borrados
  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);
     }