调整购买产品优惠列表排序逻辑
在PurchaseProductOfferLists类中,修改了查询排序逻辑,先按product_id降序排列,然后在按id降序排列。这样可以更合理地组织返回的列表,根据产品ID进行分组,每组内部再按照记录ID降序排序。
This commit is contained in:
parent
83c5d2c84b
commit
a2620f7c9a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user