From 3ef45a24c783a71cf93bcdf55196fed97df4ed72 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Wed, 17 Sep 2025 14:15:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=93=81=E7=89=8C=E6=8E=A8=E8=8D=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/service/BrandService.php | 1 + app/common/logic/BrandLogic.php | 2 +- config/route.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/admin/service/BrandService.php b/app/admin/service/BrandService.php index c35df96..61e1e65 100644 --- a/app/admin/service/BrandService.php +++ b/app/admin/service/BrandService.php @@ -43,6 +43,7 @@ class BrandService switch ($scene) { case 'index': // ====== ====== 排序 ====== ====== + $config['order']['hot'] = 'desc'; $config['order']['sort'] = 'desc'; $config['order']['id'] = 'desc'; diff --git a/app/common/logic/BrandLogic.php b/app/common/logic/BrandLogic.php index 3040572..ef46a5a 100644 --- a/app/common/logic/BrandLogic.php +++ b/app/common/logic/BrandLogic.php @@ -16,7 +16,7 @@ class BrandLogic public function getList() { - return Brand::where('status', 1)->orderBy('sort','desc')->get(['id', 'brand_code', 'brand_name', 'logo', 'description']); + return Brand::where('status', 1)->orderBy('hot','desc')->orderBy('sort','desc')->get(['id', 'brand_code', 'brand_name', 'logo', 'description']); } } \ No newline at end of file diff --git a/config/route.php b/config/route.php index 05cf625..a4b3f92 100644 --- a/config/route.php +++ b/config/route.php @@ -244,6 +244,7 @@ Route::group('/admin', function () { Route::any('/show', [app\admin\controller\BrandController::class, 'show']); Route::any('/store', [app\admin\controller\BrandController::class, 'store']); Route::any('/update', [app\admin\controller\BrandController::class, 'update']); + Route::any('/hot', [app\admin\controller\BrandController::class, 'update']); Route::any('/destroy', [app\admin\controller\BrandController::class, 'destroy']); // 车系 Route::group('/series', function () {