From 8f90a6251e19b189cdc640e444f4085a12b8b220 Mon Sep 17 00:00:00 2001 From: "674780036@qq.com" <674780036@qq.com> Date: Sun, 25 Feb 2024 21:02:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=86=E9=94=80=E8=AE=A2=E5=8D=95=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E5=B8=A6=E4=B8=8A=E5=95=86=E5=93=81=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/model/dealer/Order.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/api/model/dealer/Order.php b/app/api/model/dealer/Order.php index 775b7870..0b41c3b9 100644 --- a/app/api/model/dealer/Order.php +++ b/app/api/model/dealer/Order.php @@ -15,6 +15,7 @@ namespace app\api\model\dealer; use app\api\service\User as UserService; use app\common\model\Order as OrderModel; use app\common\model\dealer\Order as DealerOrderModel; +use app\api\model\Order as OrderApiModel; /** * 分销商订单模型 @@ -55,12 +56,17 @@ class Order extends DealerOrderModel ->paginate(15); // 数据整理 foreach ($list as &$item) { + $with = ['goods' => ['image'], 'extract_shop', 'delivery.express']; + $where = ['order_id' => $item['order_id']]; + // 查询订单记录 + $order_goods = OrderApiModel::detail($where, $with); // 我的佣金 $money = [ $item['first_user_id'] => $item['first_money'], $item['second_user_id'] => $item['second_money'], $item['third_user_id'] => $item['third_money'], ]; + $item['goods'] = $order_goods['goods']; $item['my_money'] = $money[$userId]; } return $list; @@ -97,11 +103,12 @@ class Order extends DealerOrderModel // 分销订单模型 $model = new static; // 分销商基本设置 - $setting = Setting::getItem('basic'); + $setting = Setting::getItem('basic'); // 是否开启分销功能 if (!$setting['is_open']) { return false; } + // 获取当前买家的所有上级分销商用户id $dealerUser = $model->getDealerUserId((int)$order['user_id'], (int)$setting['level'], (bool)$setting['self_buy']); // 非分销订单