From 6dd3ce5d438e90e453bf3e44e287aa835ffda339 Mon Sep 17 00:00:00 2001 From: lisy <linlangsur163@163.com> Date: 星期二, 01 八月 2023 14:05:30 +0800 Subject: [PATCH] app端接口优化 --- cloud-server-activity/src/main/resources/mapper/UserCouponMapper.xml | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/cloud-server-activity/src/main/resources/mapper/UserCouponMapper.xml b/cloud-server-activity/src/main/resources/mapper/UserCouponMapper.xml index e81d57f..0df05cb 100644 --- a/cloud-server-activity/src/main/resources/mapper/UserCouponMapper.xml +++ b/cloud-server-activity/src/main/resources/mapper/UserCouponMapper.xml @@ -13,6 +13,9 @@ DATE_FORMAT(b.endTime, '%Y-%m-%d') as endTime from t_user_coupon a left join t_coupon b on (a.couponId = b.id) - where a.`status` = 1 and b.type != 3 and a.userId = #{uid} and (b.useScope = 1 or (b.useScope = 2 and provinceCode = #{provinceCode} and cityCode = #{cityCode}) or (b.useScope = 3 and b.id in (select couponId from t_coupon_store where storeId = #{storeId}))) + where a.`status` = 1 and b.type != 3 and a.userId = #{uid} and + ( + b.useScope = 1 or (b.useScope = 2 and b.id IN (SELECT couponId FROM t_coupon_city where provinceCode = #{provinceCode} and cityCode = #{cityCode}) ) + or (b.useScope = 3 and b.id in (select couponId from t_coupon_store where storeId = #{storeId}))) </select> </mapper> -- Gitblit v1.7.1