From 99c3c2e4f18650361ce899d41cbeff76f07c4f03 Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Sat, 12 Aug 2023 15:09:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E7=AE=A1=E7=90=86=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=89=A9=E6=B5=81=E5=88=97=E8=A1=A8=E5=92=8C=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/adminapi/lists/logistics/LogisticsLists.php | 5 +++-- app/adminapi/logic/logistics/LogisticsLogic.php | 10 +++++++++- app/api/logic/LogisticsLogic.php | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/app/adminapi/lists/logistics/LogisticsLists.php b/app/adminapi/lists/logistics/LogisticsLists.php index 238a4e07..58ce115e 100755 --- a/app/adminapi/lists/logistics/LogisticsLists.php +++ b/app/adminapi/lists/logistics/LogisticsLists.php @@ -57,7 +57,7 @@ class LogisticsLists extends BaseAdminDataLists implements ListsSearchInterface public function lists(): array { return Logistics::where($this->searchWhere) - ->field(['id', 'order_id', 'order_sn', 'courier_id', 'shop_id', 'shop_name', 'shop_phone', 'shop_address', 'shop_long', 'shop_lat', 'user_id', 'user_name', 'user_phone', 'user_address', 'status', 'qh_time', 'ps_time', 'qx_time', 'user_take_code']) + ->field(['id', 'order_id', 'order_sn', 'courier_id', 'shop_id', 'shop_name', 'shop_phone', 'shop_address', 'shop_long', 'shop_lat', 'user_id', 'user_name', 'user_phone', 'user_address', 'status', 'qh_time', 'ps_time', 'qx_time','create_time', 'user_take_code']) ->where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) @@ -65,8 +65,9 @@ class LogisticsLists extends BaseAdminDataLists implements ListsSearchInterface ->each(function ($item) { $item['status_name'] = $item->status_name; $item['courier'] = Courier::alias('u') - ->field('u.nickname,a.phone') + ->field('u.nickname,a.phone,c.company_name') ->leftjoin('la_admin a', 'u.admin_id = a.id') + ->leftjoin('la_company c', 'c.id = u.company_id') ->where('u.id', $item['courier_id'])->find(); return $item; }) diff --git a/app/adminapi/logic/logistics/LogisticsLogic.php b/app/adminapi/logic/logistics/LogisticsLogic.php index 50a374d7..7edfe3f7 100755 --- a/app/adminapi/logic/logistics/LogisticsLogic.php +++ b/app/adminapi/logic/logistics/LogisticsLogic.php @@ -20,6 +20,7 @@ use app\common\model\logistics\Logistics; use app\common\logic\BaseLogic; use app\common\model\logistics\LogisticsRecord; use app\common\model\logistics\Product; +use app\common\model\logistics\User; /** @@ -43,8 +44,9 @@ class LogisticsLogic extends BaseLogic $logistics['status_name'] = $logistics->status_name; //获取配送员信息 $courier = Courier::alias('u') - ->field('u.nickname,a.phone') + ->field('u.nickname,a.phone,c.company_name') ->leftjoin('la_admin a', 'u.admin_id = a.id') + ->leftjoin('la_company c', 'c.id = u.company_id') ->where('u.id', $logistics['courier_id'])->find(); $logistics['courier'] = $courier; //获取商品信息 @@ -53,6 +55,9 @@ class LogisticsLogic extends BaseLogic $pro_item['cart_info'] = json_decode($pro_item['cart_info'], true); $pro_item['goods_name'] = $pro_item['cart_info']['product']['store_name']; $pro_item['goods_unit'] = $pro_item['cart_info']['product']['unit_name']; + $pro_item['goods_pic'] = $pro_item['cart_info']['product']['image']; + $pro_item['goods_price'] = $pro_item['cart_info']['product']['price']; + $pro_item['goods_total_price'] = $pro_item['cart_info']['product']['price'] * $pro_item['product_num']; $product_count += $pro_item['product_num']; unset($pro_item['cart_info']); return $pro_item; @@ -77,6 +82,9 @@ class LogisticsLogic extends BaseLogic unset($red_item['type'], $red_item['user_name']); })->toArray(); $logistics['records'] = $records; + //获取下单用户信息 + $orderUser = User::field('uid,nickname,phone')->where('uid',$logistics['user_id'])->find(); + $logistics['order_user'] = $orderUser; //返回数据 return $logistics->toArray(); } diff --git a/app/api/logic/LogisticsLogic.php b/app/api/logic/LogisticsLogic.php index 78b050f8..3158604d 100644 --- a/app/api/logic/LogisticsLogic.php +++ b/app/api/logic/LogisticsLogic.php @@ -211,7 +211,7 @@ class LogisticsLogic extends BaseLogic 'type' => 1, 'user_name' => $orderUser['nickname'], 'user_phone' => $orderUser['phone'], - 'content' => '用户提交订单', + 'content' => '已提交订单', 'create_time' => time(), ]); Logistics::commit();