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}
{
returnConvert.ToInt32(obj);
}
else{
else
{
return0;
}
}
...
...
@@ -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";
returnGet<RB_Member_User_Extend>(sql).ToList();
}
elseif(tier==3){
elseif(tier==3)
{
stringsql=$@"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