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
6d1f50b5
Commit
6d1f50b5
authored
Sep 01, 2020
by
吴春
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq
parents
f861459f
d8241e0c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
12 deletions
+53
-12
MallIndexStatistics.cs
Mall.Model/Extend/Statistics/MallIndexStatistics.cs
+34
-0
MallStatisticsRepository.cs
Mall.Repository/User/MallStatisticsRepository.cs
+19
-12
No files found.
Mall.Model/Extend/Statistics/MallIndexStatistics.cs
View file @
6d1f50b5
...
...
@@ -187,4 +187,38 @@ namespace Mall.Model.Extend.Statistics
/// </summary>
public
DateTime
TimeStr
{
get
;
set
;
}
}
/// <summary>
/// 分销每日用户统计
/// </summary>
[
Serializable
]
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
MallDistributorDay
{
/// <summary>
/// 时间
/// </summary>
public
DateTime
TimeStr
{
get
;
set
;
}
/// <summary>
/// 普通会员
/// </summary>
public
decimal
Pink
{
get
;
set
;
}
/// <summary>
/// VIP
/// </summary>
public
decimal
VIP
{
get
;
set
;
}
/// <summary>
/// 分享家
/// </summary>
public
decimal
Silver
{
get
;
set
;
}
/// <summary>
/// 金象【优享家】
/// </summary>
public
decimal
Gold
{
get
;
set
;
}
}
}
Mall.Repository/User/MallStatisticsRepository.cs
View file @
6d1f50b5
...
...
@@ -423,29 +423,36 @@ GROUP By B.FXGradeId,C.GradeName ", where, DateTime.Now.ToString("yyyy-MM-dd"));
}
StringBuilder
build
=
new
StringBuilder
();
build
.
AppendFormat
(
@"
SELECT TabA.TimeStr
,MAX(CASE TabA.FXGradeId WHEN 1 THEN TabA.UserCount ELSE 0 END ) AS 'Pink'
,MAX(CASE TabA.FXGradeId WHEN 2 THEN TabA.UserCount ELSE 0 END ) AS 'VIP'
,MAX(CASE TabA.FXGradeId WHEN 3 THEN TabA.UserCount ELSE 0 END ) AS 'Silver'
,MAX(CASE TabA.FXGradeId WHEN 4 THEN TabA.UserCount ELSE 0 END ) AS 'Gold'
FROM
(
SELECT B.FXGradeId,C.GradeName,COUNT(1) AS UserCount,DATE_FORMAT(A.CreateDate,'%Y-%m-%d') AS TimeStr
FROM rb_member_user AS A LEFT JOIN rb_distributor_info AS B ON A.Id=B.UserId
LEFT JOIN rb_distributor_fxgrade AS C ON B.FXGradeId=C.Grade
WHERE A.Id>19 AND B.`Status`=0 {0}
GROUP By B.FXGradeId,C.GradeName,DATE_FORMAT(A.CreateDate,'%Y%m%d')
ORDER BY DATE_FORMAT(A.CreateDate,'%Y%m%d') DESC
"
,
where
);
) AS TabA
GROUP BY TabA.TimeStr
ORDER BY TabA.TimeStr DESC"
,
where
);
List
<
object
>
resultList
=
new
List
<
object
>();
var
list
=
GetPage
<
MallDistributor
Total
>(
pageIndex
,
pageSize
,
out
rowsCount
,
build
.
ToString
()).
ToList
();
var
list
=
GetPage
<
MallDistributor
Day
>(
pageIndex
,
pageSize
,
out
rowsCount
,
build
.
ToString
()).
ToList
();
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
var
dayList
=
list
.
GroupBy
(
qitem
=>
new
{
qitem
.
TimeStr
}).
Select
(
qitem
=>
new
{
qitem
.
Key
.
TimeStr
});
foreach
(
var
dayItem
in
dayList
)
foreach
(
var
item
in
list
)
{
resultList
.
Add
(
new
{
TimeStr
=
Convert
.
ToDateTime
(
dayI
tem
.
TimeStr
).
ToString
(
"yyyy-MM-dd"
),
Pink
=
list
.
Where
(
qitem
=>
qitem
.
TimeStr
==
dayItem
.
TimeStr
&&
qitem
.
FXGradeId
==
1
)?.
FirstOrDefault
()?.
UserCount
??
0
,
VIP
=
list
.
Where
(
qitem
=>
qitem
.
TimeStr
==
dayItem
.
TimeStr
&&
qitem
.
FXGradeId
==
2
)?.
FirstOrDefault
()?.
UserCount
??
0
,
Silver
=
list
.
Where
(
qitem
=>
qitem
.
TimeStr
==
dayItem
.
TimeStr
&&
qitem
.
FXGradeId
==
3
)?.
FirstOrDefault
()?.
UserCount
??
0
,
Gold
=
list
.
Where
(
qitem
=>
qitem
.
TimeStr
==
dayItem
.
TimeStr
&&
qitem
.
FXGradeId
==
4
)?.
FirstOrDefault
()?.
UserCount
??
0
,
TimeStr
=
Convert
.
ToDateTime
(
i
tem
.
TimeStr
).
ToString
(
"yyyy-MM-dd"
),
item
.
Pink
,
item
.
VIP
,
item
.
Silver
,
item
.
Gold
});
}
;
}
}
return
resultList
;
}
...
...
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