Commit dd1ced72 authored by 吴春's avatar 吴春

提交代码

parent ffd573c5
...@@ -124,5 +124,11 @@ namespace Mall.Model.Entity.MarketingCenter ...@@ -124,5 +124,11 @@ namespace Mall.Model.Entity.MarketingCenter
/// 店铺id /// 店铺id
/// </summary> /// </summary>
public int SmallShopId { get; set; } public int SmallShopId { get; set; }
/// <summary>
/// 是否赞羊使用0-否,1-是
/// </summary>
public int IsZanYangUse { get; set; }
} }
} }
...@@ -134,6 +134,13 @@ namespace Mall.Model.Extend.User ...@@ -134,6 +134,13 @@ namespace Mall.Model.Extend.User
/// 用户等级头像 /// 用户等级头像
/// </summary> /// </summary>
public string Icon { get; set; } public string Icon { get; set; }
/// <summary>
/// 是否赞羊使用0-否,1-是
/// </summary>
public int IsZanYangUse { get; set; }
} }
......
...@@ -224,7 +224,7 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons ...@@ -224,7 +224,7 @@ SELECT a.ID as MemberCouponId,a.UserId,b.`Name`,b.CouponType,b.UseType,b.MinCons
} }
if (query.SmallShopId > 0) if (query.SmallShopId > 0)
{ {
where += $" AND ( a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}={query.SmallShopId} or a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}=0)"; where += $" AND ( a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}={query.SmallShopId} or ( a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}=0 and a.{nameof(RB_DiscountCoupon_Extend.IsZanYangUse)}=0))";
} }
else { else {
...@@ -340,8 +340,7 @@ on a.CouponId=b.ID {where} "; ...@@ -340,8 +340,7 @@ on a.CouponId=b.ID {where} ";
if (query.SmallShopId > 0) if (query.SmallShopId > 0)
{ {
builder.Append($" AND ( a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}={query.SmallShopId} or a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}=0)"); builder.Append($" AND ( a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}={query.SmallShopId} or (a.{nameof(RB_DiscountCoupon_Extend.SmallShopId)}=0 and a.{nameof(RB_DiscountCoupon_Extend.IsZanYangUse)}=0))");
} }
else else
{ {
......
...@@ -325,12 +325,12 @@ WHERE 1=1 {0} ...@@ -325,12 +325,12 @@ WHERE 1=1 {0}
public List<RB_Member_User_Extend> GetListExtRepository(RB_Member_User_Extend dmodel) public List<RB_Member_User_Extend> GetListExtRepository(RB_Member_User_Extend dmodel)
{ {
string where = " and d.Status=0 "; string where = " and d.Status=0 ";
if (dmodel.TenantId > 0) if (dmodel.TenantId > 0)
{ {
where += $@" and u.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}"; where += $@" and u.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
where += $@" and B.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}"; where += $@" and B.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
} }
if (dmodel.MallBaseId > 0) if (dmodel.MallBaseId > 0)
{ {
...@@ -522,8 +522,13 @@ where {where} ...@@ -522,8 +522,13 @@ where {where}
} }
if (dmodel.SmallShopId > 0) if (dmodel.SmallShopId > 0)
{ {
where += $@" and {nameof(RB_Member_User.SmallShopId)}={dmodel.SmallShopId}"; where += $@" and {nameof(RB_Member_User.SmallShopId)}={dmodel.SmallShopId} and {nameof(RB_Member_User_Extend.IsZanYangUse)}=0";
}
else
{
where += $@" and {nameof(RB_Member_User.SmallShopId)}=0";
} }
string sql = $@" string sql = $@"
select * from RB_Member_User where {where} order by CreateDate desc select * from RB_Member_User where {where} order by CreateDate desc
"; ";
...@@ -569,8 +574,13 @@ select * from RB_Member_User where {where} order by CreateDate desc ...@@ -569,8 +574,13 @@ select * from RB_Member_User where {where} order by CreateDate desc
} }
if (dmodel.SmallShopId > 0) if (dmodel.SmallShopId > 0)
{ {
where += $@" and {nameof(RB_Member_User.SmallShopId)}={dmodel.SmallShopId}"; where += $@" and {nameof(RB_Member_User.SmallShopId)}={dmodel.SmallShopId} and {nameof(RB_Member_User_Extend.IsZanYangUse)}=0";
} }
else
{
where += $@" and {nameof(RB_Member_User.SmallShopId)}=0";
}
if (!string.IsNullOrEmpty(dmodel.UserIds)) if (!string.IsNullOrEmpty(dmodel.UserIds))
{ {
where += $@" and {nameof(RB_Member_User.Id)} in({dmodel.UserIds})"; where += $@" and {nameof(RB_Member_User.Id)} in({dmodel.UserIds})";
...@@ -1024,8 +1034,8 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use ...@@ -1024,8 +1034,8 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
{ {
string sql = $@" select GetSmallShopChildrenList_AllUser({id})"; string sql = $@" select GetSmallShopChildrenList_AllUser({id})";
object result= ExecuteScalar(sql); object result = ExecuteScalar(sql);
if (result!=null) if (result != null)
{ {
return result.ToString(); return result.ToString();
} }
......
...@@ -690,9 +690,9 @@ namespace Mall.WebApi.Controllers.User ...@@ -690,9 +690,9 @@ namespace Mall.WebApi.Controllers.User
demodel.TenantId = userInfo.TenantId; demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId; demodel.MallBaseId = userInfo.MallBaseId;
demodel.UserId = userInfo.UserId; demodel.UserId = userInfo.UserId;
var list= userModule.GetUserMyTeamPageListForFX(pageModel.pageIndex, pageModel.pageSize, out long count, demodel); var list = userModule.GetUserMyTeamPageListForFX(pageModel.pageIndex, pageModel.pageSize, out long count, demodel);
pageModel.count = Convert.ToInt32(count); pageModel.count = Convert.ToInt32(count);
pageModel.pageData = list; pageModel.pageData = list;
return ApiResult.Success("", pageModel); return ApiResult.Success("", pageModel);
...@@ -855,7 +855,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -855,7 +855,7 @@ namespace Mall.WebApi.Controllers.User
var userInfo = AppletUserInfo; var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString()); ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_Member_Footmark_Extend demodel = JsonConvert.DeserializeObject<RB_Member_Footmark_Extend>(req.msg.ToString()); RB_Member_Footmark_Extend demodel = JsonConvert.DeserializeObject<RB_Member_Footmark_Extend>(req.msg.ToString());
demodel.UserId = userInfo.UserId; demodel.UserId = userInfo.UserId;
//HK 2020-08-27新增 //HK 2020-08-27新增
JObject parms = JObject.Parse(req.msg.ToString()); JObject parms = JObject.Parse(req.msg.ToString());
...@@ -1013,17 +1013,32 @@ namespace Mall.WebApi.Controllers.User ...@@ -1013,17 +1013,32 @@ namespace Mall.WebApi.Controllers.User
else else
{ {
var oldLogisticsModel = couponModule.GetDiscountCouponList(new RB_DiscountCoupon_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, ID = query.CouponId }).FirstOrDefault(); var oldLogisticsModel = couponModule.GetDiscountCouponList(new RB_DiscountCoupon_Extend { TenantId = query.TenantId, MallBaseId = query.MallBaseId, ID = query.CouponId }).FirstOrDefault();
var allMemberInfo = userModule.GetMemberUserInfo(userInfo.UserId);
if (oldLogisticsModel == null || oldLogisticsModel.ID == 0) if (oldLogisticsModel == null || oldLogisticsModel.ID == 0)
{ {
return ApiResult.Failed("优惠券信息不存在,请核实后再操作"); return ApiResult.Failed("优惠券信息不存在,请核实后再操作");
} }
if (allMemberInfo.SmallShopId == 0)
if (oldLogisticsModel.SmallShopId > 0 && oldLogisticsModel.SmallShopId != userInfo.UserSmallShopId)
{ {
return ApiResult.Failed("领取优惠券不属于当前店铺"); if (oldLogisticsModel.SmallShopId > 0 )
{
return ApiResult.Failed("您不属于当前店铺");
}
} }
else
{
if (oldLogisticsModel.SmallShopId > 0 && oldLogisticsModel.SmallShopId != allMemberInfo.SmallShopId)
{
return ApiResult.Failed("领取优惠券不属于当前店铺");
}
if (allMemberInfo.SmallShopId > 0 && oldLogisticsModel.SmallShopId == 0 && oldLogisticsModel.IsZanYangUse == 1)
{
return ApiResult.Failed("领取优惠券不属于当前店铺");
}
}
if (oldLogisticsModel.TotalNum != -1)//判断优惠券剩余数量是够足够 if (oldLogisticsModel.TotalNum != -1)//判断优惠券剩余数量是够足够
{ {
if (oldLogisticsModel.TotalNum < 1) if (oldLogisticsModel.TotalNum < 1)
...@@ -1045,7 +1060,7 @@ namespace Mall.WebApi.Controllers.User ...@@ -1045,7 +1060,7 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Failed("优惠券时间已过期"); return ApiResult.Failed("优惠券时间已过期");
} }
} }
var allMemberInfo = userModule.GetMemberUserInfo(userInfo.UserId);
//判断优惠券是否有等级限制 //判断优惠券是否有等级限制
if (oldLogisticsModel.OnlyMember == 1) if (oldLogisticsModel.OnlyMember == 1)
{ {
......
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