修改了 获取用户优惠卷列表-分页 中优惠卷名称搜索查询
This commit is contained in:
parent
326e7ef32d
commit
672661c708
@ -145,7 +145,11 @@ func (r *UserCouponDao) GetUserCouponPageSearch(req requests.GetUserCouponPage,
|
||||
|
||||
// 优惠卷名称
|
||||
if req.CouponName != "" {
|
||||
query = query.Where("coupon_name LIKE ?", "%"+req.CouponName+"%")
|
||||
subQuery := global.Db.Model(&model.Coupon{}).
|
||||
Select("coupon_id").
|
||||
Where("coupon_name LIKE ?", "%"+req.CouponName+"%")
|
||||
|
||||
query = query.Where(gorm.Expr("coupon_id IN (?)", subQuery))
|
||||
}
|
||||
|
||||
// 优惠卷编号
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user