From a2620f7c9ac965d4a0137d15940cfafe2b452b15 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 11 Oct 2024 18:00:07 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=B4=AD=E4=B9=B0=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E4=BC=98=E6=83=A0=E5=88=97=E8=A1=A8=E6=8E=92=E5=BA=8F?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在PurchaseProductOfferLists类中,修改了查询排序逻辑,先按product_id降序排列,然后在按id降序排列。这样可以更合理地组织返回的列表,根据产品ID进行分组,每组内部再按照记录ID降序排序。 --- .../lists/purchase_product_offer/PurchaseProductOfferLists.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php index 3470eb21f..6a4cd723e 100644 --- a/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php +++ b/app/api/lists/purchase_product_offer/PurchaseProductOfferLists.php @@ -51,7 +51,7 @@ class PurchaseProductOfferLists extends BaseApiDataLists implements ListsSearchI return PurchaseProductOffer::where($this->searchWhere) ->field(['id', 'order_id', 'product_id', 'price', 'buyer_nums', 'unit', 'is_buyer', 'buyer_confirm','need_num', 'buyer_id', 'status', 'mark']) ->limit($this->limitOffset, $this->limitLength) - ->order(['id' => 'desc']) + ->order(['product_id'=>'desc','id' => 'desc']) ->select()->each(function($item){ $find=StoreProduct::where('id',$item->product_id)->find(); $item->store_name=$find->store_name;