From 4d1d2e0745a2e9b70275c1e0a7381970728be981 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 29 Aug 2024 11:01:25 +0800 Subject: [PATCH] =?UTF-8?q?feat(CartList):=20=E4=BF=AE=E6=94=B9=E8=B4=AD?= =?UTF-8?q?=E7=89=A9=E8=BD=A6=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=E9=99=90?= =?UTF-8?q?=E5=88=B6=E5=92=8C=E5=8D=95=E4=BD=8D=E5=A4=84=E7=90=86=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/lists/cart/CartList.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/store/lists/cart/CartList.php b/app/store/lists/cart/CartList.php index bfa55e9de..f136bdfcc 100644 --- a/app/store/lists/cart/CartList.php +++ b/app/store/lists/cart/CartList.php @@ -49,7 +49,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists 'is_pay' => 0 ]; $list = Cart::where($this->searchWhere)->where($where) - ->limit($this->limitOffset, $this->limitLength) + ->limit(100) ->order(['id' => 'desc']) ->select()->each(function ($item) { @@ -91,7 +91,14 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists $item['image'] = $find['image']; $item['cost'] = $find['cost']; $item['store_name'] = $find['store_name']; - $item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name'); + $unit = StoreProductUnit::where('id', $find['unit'])->find(); + if($unit){ + $item['unit_name']=$unit['name']; + $item['is_bulk']=$unit['is_bulk']; + }else{ + $item['unit_name']=''; + $item['is_bulk']=0; + } } } return $list;