stringwhere=" and a.StartDate<NOW() and a.EndDate>NOW() and a.UseState=0 ";
stringwhere=$" and a.StartDate<NOW() and a.EndDate>NOW() AND (a.{nameof(RB_Education_MemberCoupon_Extend.HeXiao)}-a.{nameof(RB_Education_MemberCoupon_Extend.UseHeXiao)})>0 ";
stringgoodsClassWhere="";//分类
stringgoodsClassWhere="";//分类
stringgoodsWhere="";//商品
stringgoodsWhere="";//商品
stringallWhere="";//通用
stringallWhere="";//通用
if(query!=null)
if(query!=null)
{
{
if(query.TenantId>0)
if(query.TenantId>0)
{
{
where+=$" AND b.{nameof(RB_Education_Coupon_Extend.TenantId)}={query.TenantId}";
where+=$" AND b.{nameof(RB_Education_Coupon_Extend.TenantId)}={query.TenantId}";
allWhere=$" and (b.MaxDiscountsPrice>= {allPrice} or b.MaxDiscountsPrice= 0) ";
}
}
}
}
stringsql=@$" SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinConsumePrice,b.DiscountsPrice,b.MaxDiscountsPrice,b.`Describe`,a.StartDate,a.EndDate,b.ID from RB_Education_MemberCoupon as a
stringsql=@$" SELECT a.ID as MemberCouponId,a.UserId,a.HeXiao,a.UseHeXiao,b.`Name`,b.UseType,b.MaxDiscountsPrice,b.`Describe`,b.CouponIco,a.StartDate,a.EndDate,b.ID from RB_Education_MemberCoupon as a
stringwhere=" where a.`Status`=0 and a.PickupCenter=1 and (a.TotalNum=-1 or a.TotalNum>0)";
stringwhere=" where a.`Status`=0 and a.PickupCenter=1";
stringuserWhere="";//分类
stringuserWhere="";//分类
if(query!=null)
if(query!=null)
{
{
...
@@ -234,10 +233,10 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons
...
@@ -234,10 +233,10 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons
where+=$" AND a.{nameof(RB_Education_Coupon_Extend.SmallShopId)}=0";
where+=$" AND a.{nameof(RB_Education_Coupon_Extend.SmallShopId)}=0";
}
}
}
}
stringsql=@$" SELECT t.*,c.MemberNum from (SELECT a.ID,a.`Name`,a.`Describe`,a.CouponType,a.UseType,a.StartDate,a.EndDate,a.CouponIco,a.IndateDay,a.IndateType,a.TotalNum,a.CouponIco from {TableName} as a
stringsql=@$" SELECT t.*,c.MemberNum from (SELECT a.ID,a.`Name`,a.`Describe`,a.UseType,a.StartDate,a.EndDate,a.CouponIco,a.IndateDay,a.IndateType,a.TotalNum from {TableName} as a