Browse Source

商城分类追加全部

lizhen_gitee 2 months ago
parent
commit
684f39ec31
1 changed files with 16 additions and 1 deletions
  1. 16 1
      addons/shopro/controller/Category.php

+ 16 - 1
addons/shopro/controller/Category.php

@@ -14,7 +14,22 @@ class Category extends Common
     public function lists(){
         $category = Db::name('shopro_category')->where('parent_id', 1)->where('status','normal')->order('weigh', 'desc')->order('id', 'desc')->select();
         $category = list_domain_image($category,['image']);
-        $this->success('商城分类', $category);
+
+        $data[] = [
+           'id' => 0,
+           'name' => '全部',
+           'parent_id' => 0,
+           'style' => null,
+           'image' => '',
+           'description' => '',
+           'status' => 'normal',
+           'weigh' => 0,
+           'createtime' => 0,
+           'updatetime' => 0,
+        ];
+        $data = array_merge($data,$category);
+
+        $this->success('商城分类', $data);
     }
 
     //没用到