|
|
|
@@ -884,14 +884,38 @@ |
|
|
|
c.title,cubi.`name` c_user_name,cubi.phone,o.create_date,2 attribute from wx_order o |
|
|
|
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id |
|
|
|
left join wx_coupon c on o.product_id=c.id |
|
|
|
where c.type!=100 and o.order_status in(0,1,2,3,4,5) |
|
|
|
where c.type in (1,2,3,4,5,6,10,50,51) and o.order_status in(0,1,2,3,4,5) |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
<!-- and ifnull(press_current_num,0)=0 and ifnull(order_group_id,0)=0 --> |
|
|
|
union all |
|
|
|
select o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.product_id,o.payment,o.order_status, |
|
|
|
c.title,cubi.`name` c_user_name,cubi.phone,o.create_date,6 attribute from wx_order o |
|
|
|
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id |
|
|
|
left join wx_coupon c on o.product_id=c.id |
|
|
|
where c.type = 11 and o.order_status in(0,1,2,3,4,5) |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
union all |
|
|
|
select o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.product_id,o.payment,o.order_status, |
|
|
|
c.title,cubi.`name` c_user_name,cubi.phone,o.create_date,7 attribute from wx_order o |
|
|
|
left join wx_c_user_basic_info cubi on o.c_user_id=cubi.id |
|
|
|
left join wx_coupon c on o.product_id=c.id |
|
|
|
where c.type = 12 and o.order_status in(0,1,2,3,4,5) |
|
|
|
<if test=" null != tenantId and '' != tenantId"> |
|
|
|
and o.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
<if test=" null != parentTenantId and '' != parentTenantId"> |
|
|
|
and o.`parent_tenant_id` = #{parentTenantId} |
|
|
|
</if> |
|
|
|
and ifnull(press_current_num,0)=0 and ifnull(order_group_id,0)=0 |
|
|
|
union all |
|
|
|
select o.id,o.order_number,o.tenant_id,o.parent_tenant_id,o.product_id,o.payment, |
|
|
|
case o.order_status when 6 then 0 when 7 then 0 |
|
|
|
|