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 40b1ac5..64179d8 100644 --- a/config/route.php +++ b/config/route.php @@ -253,6 +253,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 () {