|
@@ -148,13 +148,16 @@
|
|
|
select tor.*, tu.avatar as avatar, gs.shop_name as shopName, gs.detailed_address as detailedAddress, gs.phone as
|
|
select tor.*, tu.avatar as avatar, gs.shop_name as shopName, gs.detailed_address as detailedAddress, gs.phone as
|
|
|
shopPhone,
|
|
shopPhone,
|
|
|
tiu.nick_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
|
|
tiu.nick_name as riderNickName,tiu.phone as riderPhone,ti.indent_id as indentId,ti.is_rider as isRider,
|
|
|
- ti.rider_user_id as riderUserId, tcu.money as couponMoney
|
|
|
|
|
|
|
+ ti.rider_user_id as riderUserId, tcu.money as couponMoney,
|
|
|
|
|
+ apr.discount_amount as activityDiscountAmount, ai.title activityTitle
|
|
|
from tb_order tor
|
|
from tb_order tor
|
|
|
left join tb_user tu on tor.user_id = tu.user_id
|
|
left join tb_user tu on tor.user_id = tu.user_id
|
|
|
left join goods_shop gs on tor.shop_id = gs.shop_id
|
|
left join goods_shop gs on tor.shop_id = gs.shop_id
|
|
|
left join tb_indent ti on tor.order_id = ti.order_id
|
|
left join tb_indent ti on tor.order_id = ti.order_id
|
|
|
left join tb_user tiu on tiu.user_id = ti.rider_user_id
|
|
left join tb_user tiu on tiu.user_id = ti.rider_user_id
|
|
|
left join tb_coupon_user tcu on tor.coupon_id = tcu.id
|
|
left join tb_coupon_user tcu on tor.coupon_id = tcu.id
|
|
|
|
|
+ left join activity_part_record apr on apr.order_id = tor.order_id
|
|
|
|
|
+ left join activity ai on ai.id = apr.activity_id
|
|
|
where 1 = 1
|
|
where 1 = 1
|
|
|
<if test="riderPhone!=null and riderPhone!=''">
|
|
<if test="riderPhone!=null and riderPhone!=''">
|
|
|
and tiu.phone =#{riderPhone}
|
|
and tiu.phone =#{riderPhone}
|