From 59d56ff9c7fb2fe0d249c01f57f19b24886a4714 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Sat, 13 Jul 2024 11:44:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BA=86=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=88=97=E8=A1=A8=E7=9A=84=E5=95=86=E5=93=81=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E8=8E=B7=E5=8F=96=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/order/OrderList.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/api/lists/order/OrderList.php b/app/api/lists/order/OrderList.php index 26548a45b..f30f4e1f8 100644 --- a/app/api/lists/order/OrderList.php +++ b/app/api/lists/order/OrderList.php @@ -56,17 +56,18 @@ class OrderList extends BaseAdminDataLists implements ListsSearchInterface $item['goods_list'] = StoreOrderCartInfo::where('oid', $item['id']) ->field('product_id,cart_num,verify_code,is_writeoff,writeoff_time,old_cart_id,cart_info')->limit(3)->select() ->each(function ($v) use ($item) { - $find = StoreBranchProduct::where('product_id', $v['product_id'])->where('store_id', $item['store_id'])->withTrashed()->find(); - if(empty($find)){ - $find = StoreProduct::where('id', $v['product_id'])->withTrashed()->find(); - } - $v['store_name'] = $find['store_name']??''; - $v['image'] = $find['image']??''; -// $v['price'] = $find['price']; - $v['price'] = $v['cart_info']['price']; + $v['store_name'] = ''; + $v['image'] = ''; + $v['price'] = ''; $v['unit_name']=''; - if(isset($find['unit']) && $find['unit'] !=''){ - $v['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name') ?? ''; + if(isset($v['cart_info'])){ + // foreach( $v['cart_info'] as $k=>$vv){ + $v['store_name'] =$v['cart_info']['name']; + $v['image'] =$v['cart_info'] ['image']; + $v['price'] = $v['cart_info']['price']; + $v['unit_name']=$v['cart_info']['unit_name']??''; + // } + } }); $item['goods_count'] = count(explode(',', $item['cart_id']));