|
|
@@ -8,7 +8,11 @@
|
|
|
and date_format(expiration_time,'%Y-%m-%d') > date_format(#{format},'%Y-%m-%d')
|
|
|
</if>
|
|
|
<if test="minMoney!=null and minMoney!=''">
|
|
|
- and ((min_money <= #{minMoney} and shop_id=0) or (min_money <= #{minMoney} and shop_id=#{shopId}))
|
|
|
+ and (
|
|
|
+ (min_money <= #{minMoney} and shop_id=0 and FIND_IN_SET(#{shopId},used_shop_id) )
|
|
|
+ or (min_money <= #{minMoney} and shop_id=#{shopId})
|
|
|
+ or (min_money <= #{minMoney} and shop_id=0 and used_shop_id =0)
|
|
|
+ )
|
|
|
</if>
|
|
|
order by expiration_time asc
|
|
|
</select>
|
|
|
@@ -69,10 +73,10 @@
|
|
|
|
|
|
<insert id="giveCoupon">
|
|
|
insert into tb_coupon_user (user_id, coupon_name, coupon_picture, create_time, expiration_time, min_money,
|
|
|
- goods_type, money, status, end_time, shop_id) values
|
|
|
+ goods_type, money, status, end_time, shop_id,used_shop_id) values
|
|
|
<foreach collection="userIdList" item="item" separator=",">
|
|
|
(#{item}, #{couponName}, #{couponPicture}, #{createTime}, #{expirationTime}, #{minMoney}, #{goodsType},
|
|
|
- #{money}, #{status}, #{endTime}, #{shopId})
|
|
|
+ #{money}, #{status}, #{endTime}, #{shopId},#{usedShopId})
|
|
|
</foreach>
|
|
|
</insert>
|
|
|
|