From 04d7bd074371bbde48bc227677cac389ff56dc46 Mon Sep 17 00:00:00 2001 From: augushong Date: Thu, 29 Oct 2020 15:17:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=86=E7=B1=BB=E6=8E=92?= =?UTF-8?q?=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/controller/Common.php | 2 +- app/index/controller/Index.php | 2 +- app/model/Category.php | 2 +- view/admin/category/create.html | 9 +++++++++ view/admin/category/edit.html | 9 +++++++++ view/admin/category/index.html | 2 ++ 6 files changed, 23 insertions(+), 3 deletions(-) diff --git a/app/index/controller/Common.php b/app/index/controller/Common.php index 7d2a544..7ac59e5 100644 --- a/app/index/controller/Common.php +++ b/app/index/controller/Common.php @@ -23,7 +23,7 @@ class Common extends BaseController $list_header_nav = Nav::where('type', 11)->order('sort asc')->where('status', 1)->select(); View::assign('list_header_nav', $list_header_nav); - $list_category_first_level = Category::where('level', 1)->where('status', 1)->where('type',3)->select(); + $list_category_first_level = Category::where('level', 1)->where('status', 1)->where('type',3)->order('sort asc')->select(); View::assign('list_category_first_level', $list_category_first_level); $list_nav_more = Nav::where('type', 8)->order('sort asc')->where('status', 1)->select(); View::assign('list_nav_more', $list_nav_more); diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 5d3c5be..7c93fb5 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -22,7 +22,7 @@ class Index extends Common $current_category = []; if (!empty($this->request->param('category_id'))) { - $sub_category = Category::where('pid', $this->request->param('category_id'))->where('type', 3)->select(); + $sub_category = Category::where('pid', $this->request->param('category_id'))->where('type', 3)->order('sort asc')->select(); $current_category = Category::find($this->request->param('category_id')); if (empty($this->request->param('sub_category_id'))) { $categorys = [$this->request->param('category_id')]; diff --git a/app/model/Category.php b/app/model/Category.php index ad70228..8ef5cb3 100644 --- a/app/model/Category.php +++ b/app/model/Category.php @@ -28,7 +28,7 @@ class Category extends Model if(empty(self::$allCategory)){ - $model_list = Category::where('type',$type)->select(); + $model_list = Category::where('type',$type)->order('sort asc')->select(); self::$allCategory = array2level($model_list,0,0); } diff --git a/view/admin/category/create.html b/view/admin/category/create.html index a5eb721..7956224 100644 --- a/view/admin/category/create.html +++ b/view/admin/category/create.html @@ -91,6 +91,15 @@ +
+
+ 排序 +

越小越靠前

+
+
+ +
+
diff --git a/view/admin/category/edit.html b/view/admin/category/edit.html index e8653e5..72df3a8 100644 --- a/view/admin/category/edit.html +++ b/view/admin/category/edit.html @@ -92,6 +92,15 @@ +
+
+ 排序 +

越小越靠前

+
+
+ +
+
diff --git a/view/admin/category/index.html b/view/admin/category/index.html index fc998b4..2f21aac 100644 --- a/view/admin/category/index.html +++ b/view/admin/category/index.html @@ -43,6 +43,7 @@ 名称 介绍 模板 + 排序 操作 @@ -54,6 +55,7 @@ {:str_repeat('|--',$vo.level)} {$vo.title} {$vo.desc} {$vo.tpl_name} + {$vo.sort}
查看