| @@ -587,7 +587,7 @@ | |||||
| <sql id="allAdminCouponOrderListColumns"> | <sql id="allAdminCouponOrderListColumns"> | ||||
| co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | ||||
| c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,c.subsidy_num, | |||||
| c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,ms.subsidy subsidy_num, | |||||
| (case when com.mc=1 then | (case when com.mc=1 then | ||||
| (select m.name from wx_merchant m, wx_coupon_merchant cm | (select m.name from wx_merchant m, wx_coupon_merchant cm | ||||
| where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name, | where m.id = cm.merchant_id and cm.product_id=co.coupon_id and cm.status = 0) else '[多商户通用]' end) as merchant_name, | ||||
| @@ -598,7 +598,7 @@ | |||||
| <sql id="allAdminCouponOrderDetailColumns"> | <sql id="allAdminCouponOrderDetailColumns"> | ||||
| co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | co.id,co.tenant_id,co.coupon_id,co.coupon_type,co.c_user_id,co.owner_id,co.b_user_id,co.order_id,co.expired_time,co.coupon_order_status,co.create_date,co.update_date,co.coupon_price, | ||||
| c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,c.subsidy_num, | |||||
| c.type,c.title,c.sale_price,c.use_price,c.price,c.unit,c.auto_refund,c.business,c.subsidy_type,ms.subsidy subsidy_num, | |||||
| bu.name, bu.phone as bphone, | bu.name, bu.phone as bphone, | ||||
| cu.phone, | cu.phone, | ||||
| m.name as merchant_name,m.id as merchant_id | m.name as merchant_name,m.id as merchant_id | ||||
| @@ -606,8 +606,8 @@ | |||||
| <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> | <select id="findListOfAdmin" parameterType="com.iformall.domain.vo.WxCouponOrderBVo" resultMap="BVoResultMap"> | ||||
| select <include refid="allAdminCouponOrderListColumns" /> | select <include refid="allAdminCouponOrderListColumns" /> | ||||
| from | |||||
| wx_coupon_order co inner join wx_coupon c on c.id = co.coupon_id | |||||
| from wx_coupon_order co | |||||
| inner join wx_coupon c on c.id = co.coupon_id | |||||
| inner join (select tco.id as tcoid, | inner join (select tco.id as tcoid, | ||||
| (select count(*) from wx_coupon_merchant tcm | (select count(*) from wx_coupon_merchant tcm | ||||
| where tcm.product_id = tco.coupon_id | where tcm.product_id = tco.coupon_id | ||||
| @@ -619,6 +619,7 @@ | |||||
| from wx_merchant_b_user bu inner join wx_merchant m on bu.merchant_id=m.id | from wx_merchant_b_user bu inner join wx_merchant m on bu.merchant_id=m.id | ||||
| where bu.tenant_id = #{tenantId} | where bu.tenant_id = #{tenantId} | ||||
| ) bu on bu.bu_id = co.b_user_id | ) bu on bu.bu_id = co.b_user_id | ||||
| left join wx_merchant_subsidy ms on co.id = ms.coupon_order_id | |||||
| left join wx_coupon_action_log cal on co.id = cal.coupon_order_id and co.coupon_id = cal.coupon_id | left join wx_coupon_action_log cal on co.id = cal.coupon_order_id and co.coupon_id = cal.coupon_id | ||||
| where 1=1 | where 1=1 | ||||
| <choose> | <choose> | ||||
| @@ -703,6 +704,7 @@ | |||||
| left join wx_c_user cu on cu.id = co.c_user_id | left join wx_c_user cu on cu.id = co.c_user_id | ||||
| left join wx_merchant_b_user bu on co.b_user_id = bu.id | left join wx_merchant_b_user bu on co.b_user_id = bu.id | ||||
| left join wx_merchant m on m.id = bu.merchant_id | left join wx_merchant m on m.id = bu.merchant_id | ||||
| left join wx_merchant_subsidy ms on co.id = ms.coupon_order_id | |||||
| where co.id = #{id} | where co.id = #{id} | ||||
| and c.id = co.coupon_id | and c.id = co.coupon_id | ||||
| </select> | </select> | ||||