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) {