|
|
@@ -66,7 +66,7 @@
|
|
|
<select id="couponCenterList" resultType="com.cyksj.model.views.CouponActiveView">
|
|
|
select *
|
|
|
from (select ca.id,
|
|
|
- c.id as coupon_id,
|
|
|
+ c.id as coupon_id,
|
|
|
c.name,
|
|
|
c.goods_type,
|
|
|
c.type,
|
|
|
@@ -88,12 +88,13 @@
|
|
|
when cu.id is null then 'collecting'
|
|
|
when cu.id is not null and cu.status != 'unused' then 'used'
|
|
|
when cu.id is not null and cu.status = 'unused' then 'received'
|
|
|
- end) as couponStatus,
|
|
|
+ end) as couponStatus,
|
|
|
(case
|
|
|
when remain_num <= 0 then 2
|
|
|
when cu.id is null then 0
|
|
|
when cu.id is not null and cu.status = 'unused' then 1
|
|
|
- end) as `order`
|
|
|
+ end) as `order`,
|
|
|
+ if(c.is_valid_time is true and c.valid_end_time < now(), false, true) as flag
|
|
|
from coupon_active ca
|
|
|
left join coupon c
|
|
|
on c.id = ca.coupon_id
|
|
|
@@ -104,6 +105,7 @@
|
|
|
and ca.`status` != 0
|
|
|
) s
|
|
|
where couponStatus != 'used'
|
|
|
+ and flag = 1
|
|
|
order by `order`
|
|
|
</select>
|
|
|
|