|
|
|
@ -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; |
|
|
|
@ -102,6 +108,7 @@ class Order extends DealerOrderModel |
|
|
|
|
if (!$setting['is_open']) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 获取当前买家的所有上级分销商用户id |
|
|
|
|
$dealerUser = $model->getDealerUserId((int)$order['user_id'], (int)$setting['level'], (bool)$setting['self_buy']); |
|
|
|
|
// 非分销订单 |
|
|
|
|