|
|
@@ -88,7 +88,8 @@
|
|
|
ti.rider_user_id as riderUserId, tcu.money as couponMoney,
|
|
|
apr.discount_amount as activityDiscountAmount, ai.title activityTitle,tiu.rider_station_id as riderStationId,
|
|
|
(select rs.station_name from rider_station rs where rs.id =tiu.rider_station_id ) as stationName,
|
|
|
- (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName
|
|
|
+ (select st.shop_type_name from shop_type st where st.id =gs.shop_type_id ) as shopTypeName,
|
|
|
+ (case when tcu.shop_id =0 then '平台' else gs2.shop_name end) couponTypeRemark,
|
|
|
from tb_order tor
|
|
|
left join tb_user tu on tor.user_id = tu.user_id
|
|
|
left join goods_shop gs on tor.shop_id = gs.shop_id
|
|
|
@@ -97,6 +98,7 @@
|
|
|
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
|
|
|
+ left join goods_shop gs2 on gs2.shop_id=tcu.shop_id
|
|
|
where 1 = 1
|
|
|
<if test="query.riderPhone!=null and query.riderPhone!=''">
|
|
|
and tiu.phone =#{query.riderPhone}
|
|
|
@@ -149,6 +151,12 @@
|
|
|
<if test="query.shopTypeId!=null and query.shopTypeId!=''">
|
|
|
and gs.shop_type_id=#{query.shopTypeId}
|
|
|
</if>
|
|
|
+ <if test="query.couponType=='0'">
|
|
|
+ and tcu.shop_id =0
|
|
|
+ </if>
|
|
|
+ <if test="query.couponType=='1'">
|
|
|
+ and tcu.shop_id !=0
|
|
|
+ </if>
|
|
|
order by tor.pay_time desc, tor.create_time desc
|
|
|
</select>
|
|
|
|