Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mall.oytour.com
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
mall.oytour.com
Commits
e00ee170
Commit
e00ee170
authored
Aug 27, 2020
by
吴春
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
906985ab
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
71 additions
and
34 deletions
+71
-34
UserModule.cs
Mall.Module.User/UserModule.cs
+24
-6
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+47
-28
No files found.
Mall.Module.User/UserModule.cs
View file @
e00ee170
...
@@ -263,7 +263,7 @@ namespace Mall.Module.User
...
@@ -263,7 +263,7 @@ namespace Mall.Module.User
public
int
AddMemberUserInfo
(
RB_Member_User_Extend
demodel
)
public
int
AddMemberUserInfo
(
RB_Member_User_Extend
demodel
)
{
{
int
result
=
0
;
int
result
=
0
;
result
=
member_UserRepository
.
Insert
(
demodel
);
result
=
member_UserRepository
.
Insert
(
demodel
);
//result = member_UserRepository.SetMemberUserRepository(demodel);
//result = member_UserRepository.SetMemberUserRepository(demodel);
return
result
;
return
result
;
}
}
...
@@ -3399,7 +3399,7 @@ namespace Mall.Module.User
...
@@ -3399,7 +3399,7 @@ namespace Mall.Module.User
UserName
=
umodel
.
Name
,
UserName
=
umodel
.
Name
,
umodel
.
Photo
,
umodel
.
Photo
,
GradeName
,
GradeName
,
GradeIcon
=
Icon
,
GradeIcon
=
Icon
,
SuperiorId
,
SuperiorId
,
SuperiorName
,
SuperiorName
,
DistributorGradeEntrance
=
HpEnabled
==
1
?
2
:
(
basicsModel
?.
GradeEntrance
??
2
),
DistributorGradeEntrance
=
HpEnabled
==
1
?
2
:
(
basicsModel
?.
GradeEntrance
??
2
),
...
@@ -6311,7 +6311,12 @@ namespace Mall.Module.User
...
@@ -6311,7 +6311,12 @@ namespace Mall.Module.User
/// <returns></returns>
/// <returns></returns>
public
object
GerSmallShopsMyTeamTitelListForFX
(
AppletUserInfo
userInfo
)
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
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
>();
var
fxList
=
new
List
<
RB_Distributor_FXGrade_Extend
>();
...
@@ -6343,7 +6348,14 @@ namespace Mall.Module.User
...
@@ -6343,7 +6348,14 @@ namespace Mall.Module.User
/// <returns></returns>
/// <returns></returns>
public
object
GetSmallShopsMyTeamPageListForFX
(
int
pageIndex
,
int
pageSize
,
out
long
count
,
RB_Distributor_Info_Extend
demodel
)
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
});
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
>();
List
<
object
>
RList
=
new
List
<
object
>();
...
@@ -6412,7 +6424,13 @@ namespace Mall.Module.User
...
@@ -6412,7 +6424,13 @@ namespace Mall.Module.User
int
smallShopsNum
=
0
;
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
))
if
(!
string
.
IsNullOrEmpty
(
UserIds
))
{
{
string
[]
arr
=
UserIds
.
Split
(
','
);
string
[]
arr
=
UserIds
.
Split
(
','
);
...
...
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
e00ee170
...
@@ -26,43 +26,56 @@ namespace Mall.Repository.User
...
@@ -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
)
public
List
<
RB_Member_User_Extend
>
GetPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowCount
,
RB_Member_User_Extend
dmodel
)
{
{
string
where
=
" 1=1 "
;
string
where
=
" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
{
if
(
dmodel
.
TenantId
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
TenantId
)}
=
{
dmodel
.
TenantId
}
"
;
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
}
"
;
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
}
"
;
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
}
%'"
;
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
}
%'"
;
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
}
"
;
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
}
%'"
;
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
}
"
;
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
}
"
;
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
}
"
;
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
}
'"
;
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'"
;
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
)}
,'')=''"
;
where
+=
$@" and IFNULL(
{
nameof
(
RB_Member_User
.
Photo
)}
,'')=''"
;
}
}
//HK06-01新增查询条件
//HK06-01新增查询条件
...
@@ -70,7 +83,8 @@ namespace Mall.Repository.User
...
@@ -70,7 +83,8 @@ namespace Mall.Repository.User
{
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
OpenId
)}
= '%
{
dmodel
.
OpenId
}
%'"
;
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 "
;
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Id
)}
between 5 and 100 "
;
}
}
string
orderBy
=
"CreateDate desc"
;
string
orderBy
=
"CreateDate desc"
;
...
@@ -130,7 +144,8 @@ select * from RB_Member_User where {where} order by {orderBy}
...
@@ -130,7 +144,8 @@ select * from RB_Member_User where {where} order by {orderBy}
{
{
where
+=
$@" and
{
nameof
(
RB_Member_User
.
SuperiorId
)}
=
{
dmodel
.
SuperiorId
}
"
;
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
}
)"
;
where
+=
$@" and
{
nameof
(
RB_Member_User
.
Id
)}
in(
{
dmodel
.
UserIds
}
)"
;
}
}
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
if
(!
string
.
IsNullOrEmpty
(
dmodel
.
StartTime
))
...
@@ -299,7 +314,7 @@ WHERE 1=1 {0}
...
@@ -299,7 +314,7 @@ WHERE 1=1 {0}
}
}
builder
.
AppendFormat
(
orderBy
);
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>
/// <summary>
...
@@ -369,7 +384,8 @@ where {where}
...
@@ -369,7 +384,8 @@ where {where}
{
{
return
Convert
.
ToInt32
(
obj
);
return
Convert
.
ToInt32
(
obj
);
}
}
else
{
else
{
return
0
;
return
0
;
}
}
}
}
...
@@ -574,7 +590,8 @@ INNER JOIN rb_member_user u1 on u.Id=u1.SuperiorId
...
@@ -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"
;
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
();
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
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 u1 on u.Id=u1.SuperiorId
INNER JOIN rb_member_user u2 on u1.Id=u2.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
...
@@ -664,7 +681,7 @@ WHERE u.TenantId={tenantId} and u.MallBaseId={mallBaseId} and u.SuperiorId ={uid
/// <param name="tenantId"></param>
/// <param name="tenantId"></param>
/// <param name="mallBaseId"></param>
/// <param name="mallBaseId"></param>
/// <returns></returns>
/// <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
=
""
;
string
sql
=
""
;
if
(
demodel
.
GradeId
==
1
)
if
(
demodel
.
GradeId
==
1
)
...
@@ -857,7 +874,7 @@ order by {dmodel.OrderBy} ";
...
@@ -857,7 +874,7 @@ order by {dmodel.OrderBy} ";
/// <param name="rowCount">总条数</param>
/// <param name="rowCount">总条数</param>
/// <param name="dmodel">查询条件</param>
/// <param name="dmodel">查询条件</param>
/// <returns></returns>
/// <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 "
;
string
where
=
" 1=1 "
;
if
(
dmodel
.
TenantId
>
0
)
if
(
dmodel
.
TenantId
>
0
)
...
@@ -922,6 +939,7 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
...
@@ -922,6 +939,7 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
/// <returns></returns>
/// <returns></returns>
public
string
GetSmallShopChildIdStr
(
int
id
)
public
string
GetSmallShopChildIdStr
(
int
id
)
{
{
string
sql
=
$@" select GetSmallShopChildrenList_AllUser(
{
id
}
)"
;
string
sql
=
$@" select GetSmallShopChildrenList_AllUser(
{
id
}
)"
;
return
ExecuteScalar
(
sql
).
ToString
();
return
ExecuteScalar
(
sql
).
ToString
();
}
}
...
@@ -942,7 +960,8 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
...
@@ -942,7 +960,8 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
{
{
return
Convert
.
ToInt32
(
obj
.
ToString
());
return
Convert
.
ToInt32
(
obj
.
ToString
());
}
}
else
{
else
{
return
0
;
return
0
;
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment