Commit dd1ced72 authored by 吴春's avatar 吴春

提交代码

parent ffd573c5
......@@ -124,5 +124,11 @@ namespace Mall.Model.Entity.MarketingCenter
/// 店铺id
/// </summary>
public int SmallShopId { get; set; }
/// <summary>
/// 是否赞羊使用0-否,1-是
/// </summary>
public int IsZanYangUse { get; set; }
}
}
......@@ -134,6 +134,13 @@ namespace Mall.Model.Extend.User
/// 用户等级头像
/// </summary>
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
}
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 {
......@@ -340,8 +340,7 @@ on a.CouponId=b.ID {where} ";
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
{
......
......@@ -325,12 +325,12 @@ WHERE 1=1 {0}
public List<RB_Member_User_Extend> GetListExtRepository(RB_Member_User_Extend dmodel)
{
string where = " and d.Status=0 ";
if (dmodel.TenantId > 0)
{
where += $@" and u.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
where += $@" and B.{nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0)
{
......@@ -522,8 +522,13 @@ where {where}
}
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 = $@"
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)
{
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))
{
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
{
string sql = $@" select GetSmallShopChildrenList_AllUser({id})";
object result= ExecuteScalar(sql);
if (result!=null)
object result = ExecuteScalar(sql);
if (result != null)
{
return result.ToString();
}
......
......@@ -690,9 +690,9 @@ namespace Mall.WebApi.Controllers.User
demodel.TenantId = userInfo.TenantId;
demodel.MallBaseId = userInfo.MallBaseId;
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.pageData = list;
return ApiResult.Success("", pageModel);
......@@ -855,7 +855,7 @@ namespace Mall.WebApi.Controllers.User
var userInfo = AppletUserInfo;
ResultPageModel pagelist = JsonConvert.DeserializeObject<ResultPageModel>(req.msg.ToString());
RB_Member_Footmark_Extend demodel = JsonConvert.DeserializeObject<RB_Member_Footmark_Extend>(req.msg.ToString());
demodel.UserId = userInfo.UserId;
//HK 2020-08-27新增
JObject parms = JObject.Parse(req.msg.ToString());
......@@ -1013,17 +1013,32 @@ namespace Mall.WebApi.Controllers.User
else
{
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)
{
return ApiResult.Failed("优惠券信息不存在,请核实后再操作");
}
if (oldLogisticsModel.SmallShopId > 0 && oldLogisticsModel.SmallShopId != userInfo.UserSmallShopId)
if (allMemberInfo.SmallShopId == 0)
{
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)
......@@ -1045,7 +1060,7 @@ namespace Mall.WebApi.Controllers.User
return ApiResult.Failed("优惠券时间已过期");
}
}
var allMemberInfo = userModule.GetMemberUserInfo(userInfo.UserId);
//判断优惠券是否有等级限制
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