Commit e00ee170 authored by 吴春's avatar 吴春

提交代码

parent 906985ab
......@@ -263,7 +263,7 @@ namespace Mall.Module.User
public int AddMemberUserInfo(RB_Member_User_Extend demodel)
{
int result = 0;
result= member_UserRepository.Insert(demodel);
result = member_UserRepository.Insert(demodel);
//result = member_UserRepository.SetMemberUserRepository(demodel);
return result;
}
......@@ -3399,7 +3399,7 @@ namespace Mall.Module.User
UserName = umodel.Name,
umodel.Photo,
GradeName,
GradeIcon=Icon,
GradeIcon = Icon,
SuperiorId,
SuperiorName,
DistributorGradeEntrance = HpEnabled == 1 ? 2 : (basicsModel?.GradeEntrance ?? 2),
......@@ -3415,7 +3415,7 @@ namespace Mall.Module.User
IsVip,
VipExpiryDate = model.VipExpiryDate.HasValue ? model.VipExpiryDate.Value.ToString("yyyy-MM-dd") : "",
VipBuyCommission,
}
};
}
......@@ -6311,7 +6311,12 @@ namespace Mall.Module.User
/// <returns></returns>
public object GerSmallShopsMyTeamTitelListForFX(AppletUserInfo userInfo)
{
string UserIds = member_UserRepository.GetSmallShopChildIdStr(userInfo.SmallShopId);
string UserIds = "-1";
if (userInfo.SmallShopId > 0)
{
UserIds = member_UserRepository.GetSmallShopChildIdStr(userInfo.SmallShopId);
}
//获取下级所有等级
var disList = distributor_InfoRepository.GetFXGreadeListForMyTeam(new RB_Distributor_Info_Extend() { UserIds = UserIds, TenantId = userInfo.TenantId, MallBaseId = userInfo.MallBaseId });
var fxList = new List<RB_Distributor_FXGrade_Extend>();
......@@ -6343,7 +6348,14 @@ namespace Mall.Module.User
/// <returns></returns>
public object GetSmallShopsMyTeamPageListForFX(int pageIndex, int pageSize, out long count, RB_Distributor_Info_Extend demodel)
{
string UserIds = member_UserRepository.GetSmallShopChildIdStr(demodel.UserId ?? 0);
string UserIds = "-1";
if ((demodel.UserId ?? 0) > 0)
{
UserIds = member_UserRepository.GetSmallShopChildIdStr(demodel.UserId ?? 0);
}
// string UserIds = member_UserRepository.GetSmallShopChildIdStr(demodel.UserId ?? 0);
var list = member_UserRepository.GetPageListForFX(pageIndex, pageSize, out count, new RB_Member_User_Extend() { UserIds = UserIds, FXGradeId = demodel.FXGradeId, Name = demodel.Name, TenantId = demodel.TenantId, MallBaseId = demodel.MallBaseId });
List<object> RList = new List<object>();
......@@ -6412,7 +6424,13 @@ namespace Mall.Module.User
int smallShopsNum = 0;
//求其所有下线的数量
var UserIds = member_UserRepository.GetSmallShopChildIdStr(model.Id);
string UserIds = "";
if (model.Id > 0)
{
UserIds = member_UserRepository.GetSmallShopChildIdStr(model.Id);
}
// UserIds = member_UserRepository.GetSmallShopChildIdStr(model.Id);
if (!string.IsNullOrEmpty(UserIds))
{
string[] arr = UserIds.Split(',');
......
......@@ -26,43 +26,56 @@ namespace Mall.Repository.User
public List<RB_Member_User_Extend> GetPageList(int pageIndex, int pageSize, out long rowCount, RB_Member_User_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0) {
if (dmodel.TenantId > 0)
{
where += $@" and {nameof(RB_Member_User.TenantId)}={dmodel.TenantId}";
}
if (dmodel.MallBaseId > 0) {
if (dmodel.MallBaseId > 0)
{
where += $@" and {nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
}
if (dmodel.Id > 0) {
if (dmodel.Id > 0)
{
where += $@" and {nameof(RB_Member_User.Id)}={dmodel.Id}";
}
if (!string.IsNullOrEmpty(dmodel.Name)) {
}
if (!string.IsNullOrEmpty(dmodel.Name))
{
where += $@" and {nameof(RB_Member_User.Name)} like '%{dmodel.Name}%'";
}
if (!string.IsNullOrEmpty(dmodel.AliasName)) {
if (!string.IsNullOrEmpty(dmodel.AliasName))
{
where += $@" and {nameof(RB_Member_User.AliasName)} like '%{dmodel.AliasName}%'";
}
if (dmodel.Source > 0) {
if (dmodel.Source > 0)
{
where += $@" and {nameof(RB_Member_User.Source)} ={(int)dmodel.Source}";
}
if (!string.IsNullOrEmpty(dmodel.Moblie)) {
if (!string.IsNullOrEmpty(dmodel.Moblie))
{
where += $@" and {nameof(RB_Member_User.Moblie)} like '%{dmodel.Moblie}%'";
}
if (dmodel.MemberGrade > 0) {
if (dmodel.MemberGrade > 0)
{
where += $@" and {nameof(RB_Member_User.MemberGrade)}={dmodel.MemberGrade}";
}
if (dmodel.SuperiorId > 0) {
if (dmodel.SuperiorId > 0)
{
where += $@" and {nameof(RB_Member_User.SuperiorId)}={dmodel.SuperiorId}";
}
if (dmodel.IsDistributor > 0) {
if (dmodel.IsDistributor > 0)
{
where += $@" and {nameof(RB_Member_User.IsDistributor)}={dmodel.IsDistributor}";
}
if (!string.IsNullOrEmpty(dmodel.StartTime)) {
if (!string.IsNullOrEmpty(dmodel.StartTime))
{
where += $@" and {nameof(RB_Member_User.CreateDate)} >='{dmodel.StartTime}'";
}
if (!string.IsNullOrEmpty(dmodel.EndTime)) {
if (!string.IsNullOrEmpty(dmodel.EndTime))
{
where += $@" and {nameof(RB_Member_User.CreateDate)} <='{dmodel.EndTime} 23:59:59'";
}
if (dmodel.IsEmptyUserPhoto == 1) {
if (dmodel.IsEmptyUserPhoto == 1)
{
where += $@" and IFNULL({nameof(RB_Member_User.Photo)},'')=''";
}
//HK06-01新增查询条件
......@@ -70,7 +83,8 @@ namespace Mall.Repository.User
{
where += $@" and {nameof(RB_Member_User.OpenId)} = '%{dmodel.OpenId}%'";
}
if (dmodel.IsSelectCommpany == 1) {
if (dmodel.IsSelectCommpany == 1)
{
where += $@" and {nameof(RB_Member_User.Id)} between 5 and 100 ";
}
string orderBy = "CreateDate desc";
......@@ -106,7 +120,7 @@ select * from RB_Member_User where {where} order by {orderBy}
{
where += $@" and {nameof(RB_Member_User.Name)} like '%{dmodel.Name}%'";
}
if (!string.IsNullOrEmpty(dmodel.UserNameStr))
if (!string.IsNullOrEmpty(dmodel.UserNameStr))
{
where += $@" and {nameof(RB_Member_User.Name)} in({dmodel.UserNameStr})";
}
......@@ -130,7 +144,8 @@ select * from RB_Member_User where {where} order by {orderBy}
{
where += $@" and {nameof(RB_Member_User.SuperiorId)}={dmodel.SuperiorId}";
}
if (!string.IsNullOrEmpty(dmodel.UserIds)) {
if (!string.IsNullOrEmpty(dmodel.UserIds))
{
where += $@" and {nameof(RB_Member_User.Id)} in({dmodel.UserIds})";
}
if (!string.IsNullOrEmpty(dmodel.StartTime))
......@@ -267,7 +282,7 @@ select * from RB_Member_User where {where} order by CreateDate desc
{
where += $@" and u.{nameof(RB_Member_User.Id)} in({dmodel.UserIds})";
}
if (dmodel.FXGradeId > 0)
if (dmodel.FXGradeId > 0)
{
where += $@" and d.{nameof(RB_Distributor_Info.FXGradeId)}={dmodel.FXGradeId}";
}
......@@ -299,7 +314,7 @@ WHERE 1=1 {0}
}
builder.AppendFormat(orderBy);
return GetPage<RB_Member_User_Extend>(pageIndex, pageSize, out rowCount,builder.ToString()).ToList();
return GetPage<RB_Member_User_Extend>(pageIndex, pageSize, out rowCount, builder.ToString()).ToList();
}
/// <summary>
......@@ -354,7 +369,7 @@ WHERE 1=1 {0}
{
where += $@" and d.{nameof(RB_Distributor_Info.FXGradeId)}={dmodel.FXGradeId}";
}
if (!string.IsNullOrEmpty(dmodel.FXGradeIds))
if (!string.IsNullOrEmpty(dmodel.FXGradeIds))
{
where += $@" and d.{nameof(RB_Distributor_Info.FXGradeId)} in({dmodel.FXGradeIds})";
}
......@@ -369,7 +384,8 @@ where {where}
{
return Convert.ToInt32(obj);
}
else {
else
{
return 0;
}
}
......@@ -447,7 +463,7 @@ select * from RB_Member_User where {where} order by CreateDate desc
{
where += $@" and {nameof(RB_Member_User.MallBaseId)}={dmodel.MallBaseId}";
}
if (!string.IsNullOrEmpty(dmodel.AliasName))
{
where += $@" and ({nameof(RB_Member_User.Name)} like '%{dmodel.AliasName}%' or {nameof(RB_Member_User.Moblie)} like '%{dmodel.AliasName}%' or {nameof(RB_Member_User.Id)} like '%{dmodel.AliasName}%')";
......@@ -530,7 +546,7 @@ select * from RB_Member_User where {where} order by CreateDate desc
{
where += $@" and {nameof(RB_Member_User.SuperiorId)}={dmodel.SuperiorId}";
}
if (dmodel.IsDistributor > 0)
if (dmodel.IsDistributor > 0)
{
where += $@" and {nameof(RB_Member_User.IsDistributor)}={dmodel.IsDistributor}";
}
......@@ -574,7 +590,8 @@ INNER JOIN rb_member_user u1 on u.Id=u1.SuperiorId
WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId in ({uids}) GROUP BY u.SuperiorId";
return Get<RB_Member_User_Extend>(sql).ToList();
}
else if (tier == 3) {
else if (tier == 3)
{
string sql = $@"SELECT u.SuperiorId,COUNT(0) AS ReferralsNum FROM rb_member_user u
INNER JOIN rb_member_user u1 on u.Id=u1.SuperiorId
INNER JOIN rb_member_user u2 on u1.Id=u2.SuperiorId
......@@ -664,7 +681,7 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={uid
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
public List<RB_Member_User_Extend> GetDistributorReferralsPageList(int pageIndex,int pageSize,out long count, RB_Distributor_Info_Extend demodel)
public List<RB_Member_User_Extend> GetDistributorReferralsPageList(int pageIndex, int pageSize, out long count, RB_Distributor_Info_Extend demodel)
{
string sql = "";
if (demodel.GradeId == 1)
......@@ -857,7 +874,7 @@ order by {dmodel.OrderBy} ";
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
public List<RB_Member_User_Extend> GetRankingList( RB_Member_User_Extend dmodel)
public List<RB_Member_User_Extend> GetRankingList(RB_Member_User_Extend dmodel)
{
string where = " 1=1 ";
if (dmodel.TenantId > 0)
......@@ -922,6 +939,7 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
/// <returns></returns>
public string GetSmallShopChildIdStr(int id)
{
string sql = $@" select GetSmallShopChildrenList_AllUser({id})";
return ExecuteScalar(sql).ToString();
}
......@@ -942,7 +960,8 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
{
return Convert.ToInt32(obj.ToString());
}
else {
else
{
return 0;
}
}
......@@ -1021,7 +1040,7 @@ Name=@Name,Photo=@Photo
WHERE Id=@Id
");
dynamicParameters.Add("Name", extModel.Name);
dynamicParameters.Add("Photo", extModel.Photo);
dynamicParameters.Add("Id", extModel.Id);
var result = base.Execute(builder.ToString(), dynamicParameters);
......
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