@@ -223,11 +223,18 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons
userWhere+=$" AND {nameof(RB_DiscountCoupon_Extend.UserId)}={query.UserId}";
}
}
// string sql = @$" SELECT t.*,c.MemberNum from (SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.MinConsumePrice,a.MaxDiscountsPrice,a.DiscountsPrice,a.IndateDay,a.IndateType from rb_discountcoupon as a
// {where} and a.IndateType=1
//UNION ALL
//SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.MinConsumePrice,a.MaxDiscountsPrice,a.DiscountsPrice,a.IndateDay,a.IndateType from rb_discountcoupon as a
// {where} and a.IndateType=2 and a.StartDate>NOW() and a.EndDate<NOW() )
//as t LEFT JOIN (SELECT CouponId,COUNT(*) as MemberNum from rb_member_discountcoupon where `Status`=0 and UseState!=2 {userWhere} GROUP BY CouponId) as c on t.ID=c.CouponId ";
stringsql=@$" SELECT t.*,c.MemberNum from (SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.MinConsumePrice,a.MaxDiscountsPrice,a.DiscountsPrice,a.IndateDay,a.IndateType from rb_discountcoupon as a