Commit d39e2052 authored by liudong1993's avatar liudong1993
parents 69f5a72e cd9eb2e5
...@@ -208,14 +208,40 @@ namespace Mall.Module.MarketingCenter ...@@ -208,14 +208,40 @@ namespace Mall.Module.MarketingCenter
{ {
foreach (var linkItem in linkArray) foreach (var linkItem in linkArray)
{ {
links.Add(new rubikLinkItem() var linkModel = new rubikLinkItem() { IsParameter = 0 };
if (linkItem["name"] != null && !string.IsNullOrWhiteSpace(linkItem["name"].ToString()))
{ {
PageName = linkItem["name"].ToString(), linkModel.PageName = linkItem["name"].ToString();
PageUrl = linkItem["value"].ToString(), }
new_link_url = linkItem["new_link_url"].ToString(), if (string.IsNullOrWhiteSpace(linkModel.PageName))
IsParameter = 0, {
ParameterValue = linkItem["name"].ToString(), linkModel.PageName = linkItem["PageName"].ToString();
}); }
if (linkItem["value"] != null && !string.IsNullOrWhiteSpace(linkItem["value"].ToString()))
{
linkModel.PageUrl = linkItem["value"].ToString();
}
if (string.IsNullOrWhiteSpace(linkModel.PageUrl))
{
linkModel.PageUrl = linkItem["PageUrl"].ToString();
}
if (linkItem["new_link_url"] != null && !string.IsNullOrWhiteSpace(linkItem["new_link_url"].ToString()))
{
linkModel.new_link_url = linkItem["new_link_url"].ToString();
}
if (string.IsNullOrWhiteSpace(linkModel.new_link_url))
{
linkModel.new_link_url = linkItem["PageUrl"].ToString();
}
if (linkItem["name"] != null && !string.IsNullOrWhiteSpace(linkItem["name"].ToString()))
{
linkModel.ParameterValue = linkItem["name"].ToString();
}
if (string.IsNullOrWhiteSpace(linkModel.ParameterValue))
{
linkModel.ParameterValue = linkItem["ParameterValue"].ToString();
}
links.Add(linkModel);
} }
} }
} }
......
...@@ -223,10 +223,10 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons ...@@ -223,10 +223,10 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons
} }
} }
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 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.CouponType=1 {where} and a.IndateType=1
UNION ALL 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 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.CouponType=2 and a.StartDate>NOW() and a.EndDate<NOW() ) {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 "; 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 ";
return GetPage<RB_DiscountCoupon_Extend>(pageIndex, pageSize, out rowCount, sql).ToList(); return GetPage<RB_DiscountCoupon_Extend>(pageIndex, pageSize, out rowCount, sql).ToList();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment