From 8af2f75854f510e50477aba871b10b63a6818b4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E5=BB=BA=E7=82=8A?= <924182103@qq.com> Date: Wed, 30 Oct 2024 16:08:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Goods/GoodsCombinationController.php | 2 +- app/Http/Controllers/Goods/GoodsSkusController.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Controllers/Goods/GoodsCombinationController.php b/app/Http/Controllers/Goods/GoodsCombinationController.php index d5efd00..33f429e 100644 --- a/app/Http/Controllers/Goods/GoodsCombinationController.php +++ b/app/Http/Controllers/Goods/GoodsCombinationController.php @@ -31,7 +31,7 @@ class GoodsCombinationController extends Controller ]) ->where('is_combination', 1) ->filter() - ->orderBy('stock', 'desc') + ->orderBy('id', 'desc') ->paginate($request->get('per_page')); $fields = implode(',', [ 'shop_id', diff --git a/app/Http/Controllers/Goods/GoodsSkusController.php b/app/Http/Controllers/Goods/GoodsSkusController.php index 9401d3d..2995433 100644 --- a/app/Http/Controllers/Goods/GoodsSkusController.php +++ b/app/Http/Controllers/Goods/GoodsSkusController.php @@ -117,7 +117,8 @@ class GoodsSkusController extends Controller $query->where('day', $day); }]) ->whereIn('id', $finalIds) - ->orderByRaw("FIELD(id, {$idField})") + ->orderByDesc('id') + //->orderByRaw("FIELD(id, {$idField})") ->paginate($request->get('per_page')); $rolesName = $request->user()->getRoleNames()->toArray(); foreach ($goodsSkus as &$sku) {