diff --git a/app/api/model/dealer/Order.php b/app/api/model/dealer/Order.php index 17443bda..4611a27b 100644 --- a/app/api/model/dealer/Order.php +++ b/app/api/model/dealer/Order.php @@ -24,6 +24,7 @@ use app\common\enum\{ order\ReceiptStatus as ReceiptStatusEnum, order\DeliveryStatus as DeliveryStatusEnum }; +use app\common\model\UserAddress as UserAddessModel; /** * 分销商订单模型 @@ -83,10 +84,11 @@ class Order extends DealerOrderModel ->paginate(15); // 数据整理 foreach ($list as &$item) { - $with = ['goods' => ['image'], 'extract_shop', 'delivery.express']; + $with = ['goods' => ['image'],'user','address']; $where = ['order_id' => $item['order_id']]; // 查询订单记录 $order_goods = OrderApiModel::detail($where, $with); + $address = UserAddessModel::where('address_id',$item['user']->address_id)->find(); // 我的佣金 $money = [ $item['first_user_id'] => $item['first_money'], @@ -94,6 +96,8 @@ class Order extends DealerOrderModel $item['third_user_id'] => $item['third_money'], ]; $item['goods'] = $order_goods['goods']; + $item['address_name'] =$address['name']; + $item['order_no'] = $item['order']['order_no']; $item['my_money'] = $money[$userId]; } return $list;