diff --git a/app/admin/controller/warehouse_order/WarehouseOrderController.php b/app/admin/controller/warehouse_order/WarehouseOrderController.php index a4dabf8e8..787347de1 100644 --- a/app/admin/controller/warehouse_order/WarehouseOrderController.php +++ b/app/admin/controller/warehouse_order/WarehouseOrderController.php @@ -227,7 +227,11 @@ class WarehouseOrderController extends BaseAdminController $order['total_num'] = 0; $total_price=0; foreach ($data as $key => &$value) { - $find = StoreProduct::where('id', $value->product_id)->find(); + if(in_array($order['store_id'],[17,18])){ + $find = StoreBranchProduct::where('product_id', $value->product_id)->where('store_id',$order['store_id'])->find(); + }else{ + $find = StoreProduct::where('id', $value->product_id)->find(); + } $value->store_name = $find['store_name'] ?? ''; $value->store_info = $find['store_info'] ?? ''; if($type==2){ diff --git a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php index 313b20ff0..6d5716796 100644 --- a/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php +++ b/app/admin/lists/store_order_cart_info/StoreOrderCartInfoTwoLists.php @@ -63,20 +63,25 @@ class StoreOrderCartInfoTwoLists extends BaseAdminDataLists implements ListsSear if ($this->request->get('start_time') == '') { $this->searchWhere[] = ['create_time', 'between', [strtotime(date('Y-m-d 00:00:00')), strtotime(date('Y-m-d 23:59:59'))]]; } + $is_group=$this->request->get('is_group'); $this->searchWhere[] = ['is_pay', '=', 1]; $this->searchWhere[] = ['status', '>=', 0]; $query = StoreOrderCartInfo::where($this->searchWhere); - if ($this->request->get('is_group') == 1) { + if ($is_group == 1) { $query->field('store_id,product_id,price,SUM(total_price) as total_price,SUM(cart_num) as cart_num')->group(['store_id', 'product_id']); } else { $query->field('store_id,product_id,price,total_price,cart_num,create_time'); } return $query->limit($this->limitOffset, $this->limitLength) - ->select()->each(function ($item) { + ->select()->each(function ($item) use($is_group){ $find = StoreProduct::where('id', $item['product_id'])->field('image,unit,cate_id,store_name,store_info')->find(); if ($find) { $item['image'] = $find['image']; //商品图片 - $item['store_name'] = $find['store_name']; //商品名称 + if($is_group==1){ + $item['store_name'] = $find['store_name'].'-'.$item['create_time']; //商品名称 + }else{ + $item['store_name'] = $find['store_name']; //商品名称 + } $item['store_info'] = $find['store_info']; //商品规格 $item['unit_name'] = StoreProductUnit::where('id', $find['unit'])->value('name') ?? ''; $item['cate_name'] = StoreCategory::where('id', $find['cate_id'])->value('name') ?? '';