From 998bf7e58a01d841e2a9b9f2b9a256ac1e6ce5ca Mon Sep 17 00:00:00 2001 From: Terry <2358269014@qq.com> Date: Fri, 3 Apr 2020 00:20:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=9C=BAh5=EF=BC=8C=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/category/CategoryMongodb.php | 2 +- services/category/CategoryMysqldb.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/services/category/CategoryMongodb.php b/services/category/CategoryMongodb.php index d42d48245..fbe9e11c9 100644 --- a/services/category/CategoryMongodb.php +++ b/services/category/CategoryMongodb.php @@ -511,7 +511,7 @@ protected function getChildCate($category_id) 'parent_id' => $category_id, 'status' => $this->getCategoryEnableStatus(), 'menu_show' => $this->getCategoryMenuShowStatus(), - ])->all(); + ])->orderBy(['sort_order' => SORT_DESC]) ->all(); $arr = []; if (is_array($data) && !empty($data)) { foreach ($data as $one) { diff --git a/services/category/CategoryMysqldb.php b/services/category/CategoryMysqldb.php index 11e495e6d..76dceafb9 100644 --- a/services/category/CategoryMysqldb.php +++ b/services/category/CategoryMysqldb.php @@ -597,7 +597,7 @@ protected function getChildCate($category_id) 'parent_id' => $category_id, 'status' => $this->getCategoryEnableStatus(), 'menu_show' => $this->getCategoryMenuShowStatus(), - ])->all(); + ])->orderBy(['sort_order' => SORT_DESC])->all(); $arr = []; if (is_array($data) && !empty($data)) { foreach ($data as $one) {