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
b0b93ade
Commit
b0b93ade
authored
Sep 16, 2020
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
da9dcf38
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
RB_Member_UserRepository.cs
Mall.Repository/User/RB_Member_UserRepository.cs
+23
-24
No files found.
Mall.Repository/User/RB_Member_UserRepository.cs
View file @
b0b93ade
...
...
@@ -1102,53 +1102,52 @@ LEFT JOIN (SELECT SuperiorId,COUNT(SuperiorId) as ChildrenNum from rb_member_use
{
if
(
query
.
TenantId
>
0
)
{
where
+=
string
.
Format
(
" AND TenantId={0} "
,
query
.
TenantId
);
where
+=
string
.
Format
(
" AND
A.
TenantId={0} "
,
query
.
TenantId
);
}
if
(
query
.
MallBaseId
>
0
)
{
where
+=
string
.
Format
(
" AND MallBaseId={0} "
,
query
.
MallBaseId
);
where
+=
string
.
Format
(
" AND
A.
MallBaseId={0} "
,
query
.
MallBaseId
);
}
if
(!
string
.
IsNullOrWhiteSpace
(
query
.
UserIds
))
{
where
+=
string
.
Format
(
" AND UserId IN({0}) "
,
query
.
UserIds
);
where
+=
string
.
Format
(
" AND
A.
UserId IN({0}) "
,
query
.
UserIds
);
}
if
(
query
.
Id
>
0
)
{
where
+=
string
.
Format
(
" AND UserId IN({0}) "
,
query
.
Id
);
where
+=
string
.
Format
(
" AND
A.
UserId IN({0}) "
,
query
.
Id
);
}
}
if
(
IsGetCurrentMonth
)
{
where
+=
string
.
Format
(
" AND DATE_FORMAT(CreateDate, '%Y/%m')=DATE_FORMAT('{0}','%Y/%m') "
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
));
where
+=
string
.
Format
(
" AND DATE_FORMAT(
A.
CreateDate, '%Y/%m')=DATE_FORMAT('{0}','%Y/%m') "
,
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
));
}
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT UserId AS Id,IsRemit,SUM(A.Commission) AS Commission
FROM
(
SELECT
UserId,SUM(Commission) AS Commission,
IsRemit
FROM rb_goods_ordercommission
WHERE
UserId>0
{0}
GROUP BY UserId
SELECT
A.UserId,SUM(A.Commission) AS Commission,A.
IsRemit
FROM rb_goods_ordercommission
AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE
B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6)
{0}
GROUP BY
A.
UserId
UNION ALL
SELECT UserId,SUM(Commission) AS Commission,RemitStatus AS IsRemit
FROM rb_goods_orderintroduction
WHERE UserId>0 {0}
GROUP BY UserId,RemitStatus
UNION ALL
SELECT UserId,SUM(Commission) AS Commission,IsRemit
FROM rb_vipbuy_commission
WHERE UserId>0 {0}
GROUP BY UserId,IsRemit
SELECT A.UserId,SUM(A.Commission) AS Commission,A.RemitStatus AS IsRemit
FROM rb_goods_orderintroduction AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY A.UserId,A.RemitStatus
UNION ALL
SELECT UserId,SUM(Commission) AS Commission,IsRemit
FROM rb_smallshops_commission
WHERE UserId>0 {0}
GROUP BY UserId,IsRemit
SELECT A.UserId,SUM(A.Commission) AS Commission,IsRemit
FROM rb_vipbuy_commission AS A
WHERE 1=1 {0}
GROUP BY A.UserId,A.IsRemit
UNION ALL
SELECT A.UserId,SUM(A.Commission) AS Commission,A.IsRemit
FROM rb_smallshops_commission AS A LEFT JOIN rb_goods_order AS B ON A.OrderId=B.OrderId
WHERE B.OrderStatus<>7 AND A.OrderId NOT IN(select OrderId from rb_goods_orderaftersale where ReOrderStatus<>6) {0}
GROUP BY A.UserId,A.IsRemit
) AS A GROUP BY UserId,IsRemit
"
,
where
);
return
Get
<
RB_Member_User_Extend
>(
builder
.
ToString
()).
ToList
();
...
...
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