|
@@ -67,6 +67,7 @@ class Order extends Backend
|
|
|
->join('user', 'user.id = order.user_id','LEFT')
|
|
|
->join('user intro', 'intro.id = order.intro_uid','LEFT')
|
|
|
->join('user hexiao', 'hexiao.id = order.hexiao_uid','LEFT')
|
|
|
+ ->join('unishop_order_product op', 'op.order_id = order.id','LEFT')
|
|
|
->where($where)
|
|
|
->where($where_user)
|
|
|
->count();
|
|
@@ -76,6 +77,7 @@ class Order extends Backend
|
|
|
->join('user', 'user.id = order.user_id','LEFT')
|
|
|
->join('user intro', 'intro.id = order.intro_uid','LEFT')
|
|
|
->join('user hexiao', 'hexiao.id = order.hexiao_uid','LEFT')
|
|
|
+ ->join('unishop_order_product op', 'op.order_id = order.id','LEFT')
|
|
|
->where($where)
|
|
|
->where($where_user)
|
|
|
->sum('total_price');
|
|
@@ -85,11 +87,12 @@ class Order extends Backend
|
|
|
->join('user', 'user.id = order.user_id','LEFT')
|
|
|
->join('user intro', 'intro.id = order.intro_uid','LEFT')
|
|
|
->join('user hexiao', 'hexiao.id = order.hexiao_uid','LEFT')
|
|
|
+ ->join('unishop_order_product op', 'op.order_id = order.id','LEFT')
|
|
|
->where($where)
|
|
|
->where($where_user)
|
|
|
->order($sort, $order)
|
|
|
->limit($offset, $limit)
|
|
|
- ->field('order.*,user.username,intro.username as intro_username,intro.mobile as intro_mobile,hexiao.username as hexiao_username,hexiao.mobile as hexiao_mobile')
|
|
|
+ ->field('order.*,user.username,intro.username as intro_username,intro.mobile as intro_mobile,hexiao.username as hexiao_username,hexiao.mobile as hexiao_mobile,op.product_id as op_product_id,op.title as op_title,op.number as op_number,op.spec as op_spec,op.price as op_price')
|
|
|
->select();
|
|
|
|
|
|
$list = collection($list)->toArray();
|
|
@@ -106,6 +109,13 @@ class Order extends Backend
|
|
|
$item['hexiao']['username'] = $item['hexiao_username'] ? $item['hexiao_username'] : '';
|
|
|
$item['hexiao']['mobile'] = $item['hexiao_mobile'] ? $item['hexiao_mobile'] : '';
|
|
|
|
|
|
+ $item['op'] = [];
|
|
|
+ $item['op']['product_id'] = $item['op_product_id'] ? $item['op_product_id'] : '';
|
|
|
+ $item['op']['title'] = $item['op_title'] ? $item['op_title'] : '';
|
|
|
+ $item['op']['number'] = $item['op_number'] ? $item['op_number'] : '';
|
|
|
+ $item['op']['spec'] = $item['op_spec'] ? $item['op_spec'] : '';
|
|
|
+ $item['op']['price'] = $item['op_price'] ? $item['op_price'] : '';
|
|
|
+
|
|
|
$item['have_paid_status'] = $item['have_paid'];
|
|
|
$item['have_delivered_status'] = $item['have_delivered'];
|
|
|
$item['have_received_status'] = $item['have_received'];
|