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();