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
b8dfa827
Commit
b8dfa827
authored
Jun 11, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/mall.oytour.com
into sdzq-ld
parents
cc453b28
b416ba21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
65 deletions
+77
-65
StatisticsModule.cs
Mall.Module.MarketingCenter/StatisticsModule.cs
+77
-65
No files found.
Mall.Module.MarketingCenter/StatisticsModule.cs
View file @
b8dfa827
...
@@ -470,27 +470,27 @@ namespace Mall.Module.MarketingCenter
...
@@ -470,27 +470,27 @@ namespace Mall.Module.MarketingCenter
TenantId
=
dmodel
.
TenantId
TenantId
=
dmodel
.
TenantId
},
minDate
,
maxDate
);
},
minDate
,
maxDate
);
}
}
dmodel
.
RepurchaseNum
=
0
;
dmodel
.
RepurchaseNum
=
0
;
dmodel
.
UserIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
UserIds
));
dmodel
.
UserIds
=
string
.
Join
(
","
,
list
.
Select
(
x
=>
x
.
UserIds
));
var
allOrderList
=
orderRepository
.
GetOrderByUserIds
(
dmodel
);
var
allOrderList
=
orderRepository
.
GetOrderByUserIds
(
dmodel
);
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
{
item
.
LoginEmpActive
=
loginUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
0
&&
qitem
.
SuperiorId
>
0
&&
qitem
.
SuperiorId
<
20
)?.
Count
()
??
0
;
item
.
LoginEmpActive
=
loginUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
0
&&
qitem
.
SuperiorId
>
0
&&
qitem
.
SuperiorId
<
20
)?.
Count
()
??
0
;
item
.
LoginLeaderActive
=
loginUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
1
)?.
Count
()
??
0
;
item
.
LoginLeaderActive
=
loginUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
1
)?.
Count
()
??
0
;
item
.
OrderEmpActive
=
orderUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
0
&&
qitem
.
SuperiorId
>
0
&&
qitem
.
SuperiorId
<
20
)?.
Count
()
??
0
;
item
.
OrderEmpActive
=
orderUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
0
&&
qitem
.
SuperiorId
>
0
&&
qitem
.
SuperiorId
<
20
)?.
Count
()
??
0
;
item
.
OrderLeaderActice
=
orderUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
1
)?.
Count
()
??
0
;
item
.
OrderLeaderActice
=
orderUserList
?.
Where
(
qitem
=>
Convert
.
ToDateTime
(
qitem
.
CreateDate
).
ToString
(
"yyyy-MM-dd"
)
==
item
.
CreateDate
&&
qitem
.
PostId
==
1
)?.
Count
()
??
0
;
if
(!
string
.
IsNullOrWhiteSpace
(
item
.
UserIds
))
if
(!
string
.
IsNullOrWhiteSpace
(
item
.
UserIds
))
{
{
try
try
{
{
DateTime
nowTime
=
Convert
.
ToDateTime
(
item
.
CreateDate
+
"
23:59:59
"
);
DateTime
nowTime
=
Convert
.
ToDateTime
(
item
.
CreateDate
+
"
00:00:00
"
);
var
userIdList
=
item
.
UserIds
.
Split
(
","
).
Distinct
().
ToArray
();
var
userIdList
=
item
.
UserIds
.
Split
(
","
).
Distinct
().
ToArray
();
foreach
(
var
itemUserId
in
userIdList
)
foreach
(
var
itemUserId
in
userIdList
)
{
{
int
orderNum
=
allOrderList
.
Where
(
x
=>
x
.
UserId
.
ToString
()
==
itemUserId
&&
x
.
CreateDate
<
=
nowTime
).
Count
();
int
orderNum
=
allOrderList
.
Where
(
x
=>
x
.
UserId
.
ToString
()
==
itemUserId
&&
x
.
CreateDate
<
nowTime
).
Count
();
if
(
orderNum
>
1
)
if
(
orderNum
>
1
)
{
{
item
.
RepurchaseNum
+=
1
;
item
.
RepurchaseNum
+=
1
;
...
@@ -829,26 +829,26 @@ namespace Mall.Module.MarketingCenter
...
@@ -829,26 +829,26 @@ namespace Mall.Module.MarketingCenter
{
{
#
region
本月
#
region
本月
decimal
CancelOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
CancelOrderNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
CancelOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
CancelOrderNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PeopleNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PeopleNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
OrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
OrderNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
OrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
OrderNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PayMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PayMoney
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PayMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PayMoney
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
BuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
BuyNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
BuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
BuyNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgOrderNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgOrderNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgBuyNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgBuyNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgUnitPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgUnitPrice
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgUnitPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgUnitPrice
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgBuyPrice
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
AvgBuyPrice
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MemberNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
MemberNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MemberNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
MemberNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PaymentNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PaymentNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PaymentNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PaymentNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MOrderRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
MOrderRate
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MOrderRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
MOrderRate
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
ReBuyNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
ReBuyNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
ReBuyRate
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
ReBuyRate
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
NewPeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
NewPeopleNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
NewPeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
NewPeopleNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PXNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
PXNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
VipNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
VipNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
VipNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
VipNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
YXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
YXNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
YXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
YXNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
JXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
JXNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
JXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
JXNum
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
Profit
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
Profit
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
Profit
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
Profit
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ProfitRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
ProfitRate
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ProfitRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
10
&&
x
.
Date
.
Day
<=
20
).
Sum
(
x
=>
x
.
ProfitRate
))
/
10
,
2
,
MidpointRounding
.
AwayFromZero
);
#
endregion
#
endregion
#
region
平均
#
region
平均
RList
.
Add
(
new
RList
.
Add
(
new
...
@@ -952,30 +952,31 @@ namespace Mall.Module.MarketingCenter
...
@@ -952,30 +952,31 @@ namespace Mall.Module.MarketingCenter
sProfitRate
=
ProfitRate
;
sProfitRate
=
ProfitRate
;
#
endregion
#
endregion
}
}
else
if
(
Convert
.
ToDateTime
(
SDate
).
Day
==
MaxDay
)
{
else
if
(
Convert
.
ToDateTime
(
SDate
).
Day
==
MaxDay
)
{
int
NowDay
=
MaxDay
-
20
;
int
NowDay
=
MaxDay
-
20
;
#
region
本月
#
region
本月
decimal
CancelOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
CancelOrderNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
CancelOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
CancelOrderNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PeopleNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PeopleNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
OrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
OrderNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
OrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
OrderNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PayMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PayMoney
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PayMoney
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PayMoney
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
BuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
BuyNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
BuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
BuyNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgOrderNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgOrderNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgOrderNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgBuyNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgBuyNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgUnitPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgUnitPrice
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgUnitPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgUnitPrice
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgBuyPrice
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
AvgBuyPrice
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
AvgBuyPrice
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MemberNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
MemberNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MemberNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
MemberNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PaymentNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PaymentNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PaymentNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PaymentNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MOrderRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
MOrderRate
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
MOrderRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
MOrderRate
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
ReBuyNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
ReBuyNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
ReBuyRate
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ReBuyRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
ReBuyRate
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
NewPeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
NewPeopleNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
NewPeopleNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
NewPeopleNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PXNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
PXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
PXNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
VipNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
VipNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
VipNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
VipNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
YXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
YXNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
YXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
YXNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
JXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
JXNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
JXNum
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
JXNum
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
Profit
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
Profit
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
Profit
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
Profit
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ProfitRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
ProfitRate
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
decimal
ProfitRate
=
Math
.
Round
(
Convert
.
ToDecimal
(
list
.
Where
(
x
=>
x
.
Date
.
Day
>
20
).
Sum
(
x
=>
x
.
ProfitRate
))
/
NowDay
,
2
,
MidpointRounding
.
AwayFromZero
);
#
endregion
#
endregion
#
region
平均
#
region
平均
RList
.
Add
(
new
RList
.
Add
(
new
...
@@ -1949,7 +1950,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -1949,7 +1950,8 @@ namespace Mall.Module.MarketingCenter
//根据月份遍历
//根据月份遍历
string
SMonth
=
Convert
.
ToDateTime
(
StartDate
).
ToString
(
"yyyy-MM"
);
string
SMonth
=
Convert
.
ToDateTime
(
StartDate
).
ToString
(
"yyyy-MM"
);
int
TotalMonthNum
=
0
;
int
TotalMonthNum
=
0
;
while
(
true
)
{
while
(
true
)
{
TotalMonthNum
++;
TotalMonthNum
++;
User_Statistics_Query
mmodel
=
new
User_Statistics_Query
()
{
Date
=
SMonth
};
User_Statistics_Query
mmodel
=
new
User_Statistics_Query
()
{
Date
=
SMonth
};
//查询当月数据
//查询当月数据
...
@@ -1965,10 +1967,10 @@ namespace Mall.Module.MarketingCenter
...
@@ -1965,10 +1967,10 @@ namespace Mall.Module.MarketingCenter
//int TotalVIPNum = mlist.Any() ? mlist.Max(x => x.VipLJNum) : 0;
//int TotalVIPNum = mlist.Any() ? mlist.Max(x => x.VipLJNum) : 0;
//int TotalYXNum = mlist.Any() ? mlist.Max(x => x.YXLJNum) : 0;
//int TotalYXNum = mlist.Any() ? mlist.Max(x => x.YXLJNum) : 0;
//int TotalJXNum = mlist.Any() ? mlist.Max(x => x.JXLJNum) : 0;
//int TotalJXNum = mlist.Any() ? mlist.Max(x => x.JXLJNum) : 0;
mmodel
.
PXNum
=
mlist
.
Sum
(
x
=>
x
.
PXNum
);
mmodel
.
PXNum
=
mlist
.
Sum
(
x
=>
x
.
PXNum
);
mmodel
.
VipNum
=
mlist
.
Sum
(
x
=>
x
.
VipNum
);
mmodel
.
VipNum
=
mlist
.
Sum
(
x
=>
x
.
VipNum
);
mmodel
.
YXNum
=
mlist
.
Sum
(
x
=>
x
.
YXNum
);
mmodel
.
YXNum
=
mlist
.
Sum
(
x
=>
x
.
YXNum
);
mmodel
.
JXNum
=
mlist
.
Sum
(
x
=>
x
.
JXNum
);
mmodel
.
JXNum
=
mlist
.
Sum
(
x
=>
x
.
JXNum
);
mmodel
.
TotalMNum
=
mmodel
.
PXNum
+
mmodel
.
VipNum
+
mmodel
.
YXNum
+
mmodel
.
JXNum
;
mmodel
.
TotalMNum
=
mmodel
.
PXNum
+
mmodel
.
VipNum
+
mmodel
.
YXNum
+
mmodel
.
JXNum
;
#
region
求月平均
#
region
求月平均
...
@@ -2172,7 +2174,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -2172,7 +2174,8 @@ namespace Mall.Module.MarketingCenter
#
endregion
#
endregion
MonthSList
.
Add
(
mmodel
);
MonthSList
.
Add
(
mmodel
);
if
(
SMonth
==
endTime
)
{
if
(
SMonth
==
endTime
)
{
break
;
break
;
}
}
SMonth
=
Convert
.
ToDateTime
(
SMonth
+
"-01"
).
AddMonths
(
1
).
ToString
(
"yyyy-MM"
);
SMonth
=
Convert
.
ToDateTime
(
SMonth
+
"-01"
).
AddMonths
(
1
).
ToString
(
"yyyy-MM"
);
...
@@ -2191,7 +2194,7 @@ namespace Mall.Module.MarketingCenter
...
@@ -2191,7 +2194,7 @@ namespace Mall.Module.MarketingCenter
PayMoney
=
MonthSList2
.
Sum
(
x
=>
x
.
PayMoney
),
PayMoney
=
MonthSList2
.
Sum
(
x
=>
x
.
PayMoney
),
BuyNum
=
MonthSList2
.
Sum
(
x
=>
x
.
BuyNum
),
BuyNum
=
MonthSList2
.
Sum
(
x
=>
x
.
BuyNum
),
Profit
=
MonthSList2
.
Sum
(
x
=>
x
.
Profit
),
Profit
=
MonthSList2
.
Sum
(
x
=>
x
.
Profit
),
TotalPayPeople
=
MonthSList2
.
Any
()?
MonthSList2
.
Max
(
x
=>
x
.
TotalPayPeople
)
:
0
,
TotalPayPeople
=
MonthSList2
.
Any
()
?
MonthSList2
.
Max
(
x
=>
x
.
TotalPayPeople
)
:
0
,
PXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
PXNum
),
PXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
PXNum
),
VipNum
=
MonthSList2
.
Sum
(
x
=>
x
.
VipNum
),
VipNum
=
MonthSList2
.
Sum
(
x
=>
x
.
VipNum
),
YXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
YXNum
),
YXNum
=
MonthSList2
.
Sum
(
x
=>
x
.
YXNum
),
...
@@ -2220,7 +2223,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -2220,7 +2223,8 @@ namespace Mall.Module.MarketingCenter
List
<
User_Statistics_Rate_Query
>
ReRateList
=
new
List
<
User_Statistics_Rate_Query
>();
//概率数据
List
<
User_Statistics_Rate_Query
>
ReRateList
=
new
List
<
User_Statistics_Rate_Query
>();
//概率数据
string
SRateMonth
=
startTime
;
string
SRateMonth
=
startTime
;
//这个要从查询第一个月开始
//这个要从查询第一个月开始
while
(
true
)
{
while
(
true
)
{
//求当月的所有比例 (当月-上月)/上月
//求当月的所有比例 (当月-上月)/上月
var
NowMmodel
=
MonthSList
.
Where
(
x
=>
x
.
Date
==
SRateMonth
).
FirstOrDefault
();
var
NowMmodel
=
MonthSList
.
Where
(
x
=>
x
.
Date
==
SRateMonth
).
FirstOrDefault
();
var
PreMmodel
=
MonthSList
.
Where
(
x
=>
x
.
Date
==
Convert
.
ToDateTime
(
SRateMonth
+
"-01"
).
AddMonths
(-
1
).
ToString
(
"yyyy-MM"
)).
FirstOrDefault
();
var
PreMmodel
=
MonthSList
.
Where
(
x
=>
x
.
Date
==
Convert
.
ToDateTime
(
SRateMonth
+
"-01"
).
AddMonths
(-
1
).
ToString
(
"yyyy-MM"
)).
FirstOrDefault
();
...
@@ -2648,7 +2652,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -2648,7 +2652,8 @@ namespace Mall.Module.MarketingCenter
#
region
组装
excel
数据
#
region
组装
excel
数据
List
<
ExcelDataSource
>
DataList
=
new
List
<
ExcelDataSource
>();
List
<
ExcelDataSource
>
DataList
=
new
List
<
ExcelDataSource
>();
//第一部分数据
//第一部分数据
foreach
(
var
item
in
MonthSList
)
{
foreach
(
var
item
in
MonthSList
)
{
ExcelDataSource
datarow
=
new
ExcelDataSource
()
ExcelDataSource
datarow
=
new
ExcelDataSource
()
{
{
ExcelRows
=
new
List
<
ExcelColumn
>(
23
)
{
ExcelRows
=
new
List
<
ExcelColumn
>(
23
)
{
...
@@ -2736,7 +2741,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -2736,7 +2741,8 @@ namespace Mall.Module.MarketingCenter
},
},
ColumnHight
=
30
ColumnHight
=
30
};
};
foreach
(
var
item
in
ReRateList
)
{
foreach
(
var
item
in
ReRateList
)
{
header3
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
Date
)
{
});
header3
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
item
.
Date
)
{
});
}
}
DataList
.
Add
(
header3
);
DataList
.
Add
(
header3
);
...
@@ -2760,7 +2766,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -2760,7 +2766,8 @@ namespace Mall.Module.MarketingCenter
"PAvgJXNum|金象會員成長率"
,
"PAvgJXNum|金象會員成長率"
,
"PAvgTotalMNum|會員總成長率"
"PAvgTotalMNum|會員總成長率"
};
};
foreach
(
var
item
in
RateRowList
)
{
foreach
(
var
item
in
RateRowList
)
{
var
fileNameArr
=
item
.
Split
(
'|'
);
var
fileNameArr
=
item
.
Split
(
'|'
);
ExcelDataSource
datarow2
=
new
ExcelDataSource
()
ExcelDataSource
datarow2
=
new
ExcelDataSource
()
{
{
...
@@ -2769,8 +2776,9 @@ namespace Mall.Module.MarketingCenter
...
@@ -2769,8 +2776,9 @@ namespace Mall.Module.MarketingCenter
},
},
ColumnHight
=
30
ColumnHight
=
30
};
};
foreach
(
var
qitem
in
ReRateList
)
{
foreach
(
var
qitem
in
ReRateList
)
{
JObject
parms
=
JObject
.
Parse
(
JsonHelper
.
Serialize
(
qitem
));
JObject
parms
=
JObject
.
Parse
(
JsonHelper
.
Serialize
(
qitem
));
string
mvalue
=
parms
.
GetStringValue
(
fileNameArr
[
0
]);
string
mvalue
=
parms
.
GetStringValue
(
fileNameArr
[
0
]);
datarow2
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
mvalue
+
"%"
)
{
});
datarow2
.
ExcelRows
.
Add
(
new
ExcelColumn
(
value
:
mvalue
+
"%"
)
{
});
...
@@ -2801,7 +2809,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -2801,7 +2809,8 @@ namespace Mall.Module.MarketingCenter
List
<
User_Statistics_Query
>
YearAvgSList
=
new
List
<
User_Statistics_Query
>();
//年平均统计数据
List
<
User_Statistics_Query
>
YearAvgSList
=
new
List
<
User_Statistics_Query
>();
//年平均统计数据
List
<
User_Statistics_Rate_Query
>
YearRateSList
=
new
List
<
User_Statistics_Rate_Query
>();
//年成长率统计数据
List
<
User_Statistics_Rate_Query
>
YearRateSList
=
new
List
<
User_Statistics_Rate_Query
>();
//年成长率统计数据
int
SYear
=
startYear
;
int
SYear
=
startYear
;
while
(
true
)
{
while
(
true
)
{
var
ylist
=
list
.
Where
(
x
=>
x
.
DateYear
==
SYear
).
ToList
();
var
ylist
=
list
.
Where
(
x
=>
x
.
DateYear
==
SYear
).
ToList
();
#
region
1
表统计
#
region
1
表统计
User_Statistics_Query_V2
ymodel
=
new
User_Statistics_Query_V2
()
{
Date
=
SYear
.
ToString
()
};
User_Statistics_Query_V2
ymodel
=
new
User_Statistics_Query_V2
()
{
Date
=
SYear
.
ToString
()
};
...
@@ -2873,7 +2882,7 @@ namespace Mall.Module.MarketingCenter
...
@@ -2873,7 +2882,7 @@ namespace Mall.Module.MarketingCenter
string
SDate
=
SMonth
+
"-01"
;
string
SDate
=
SMonth
+
"-01"
;
string
EDate
=
Convert
.
ToDateTime
(
SMonth
+
"-01"
).
AddMonths
(
1
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
string
EDate
=
Convert
.
ToDateTime
(
SMonth
+
"-01"
).
AddMonths
(
1
).
AddDays
(-
1
).
ToString
(
"yyyy-MM-dd"
);
int
MaxDay
=
Convert
.
ToDateTime
(
EDate
).
Day
;
int
MaxDay
=
Convert
.
ToDateTime
(
EDate
).
Day
;
//分三段求 每期的平均
//分三段求 每期的平均
if
(
true
)
if
(
true
)
{
{
...
@@ -3020,7 +3029,7 @@ namespace Mall.Module.MarketingCenter
...
@@ -3020,7 +3029,7 @@ namespace Mall.Module.MarketingCenter
yProfitRate
+=
ProfitRate
;
yProfitRate
+=
ProfitRate
;
#
endregion
#
endregion
}
}
#
region
月平均赋值
#
region
月平均赋值
mmodel
.
MAvgPeopleNum
=
Math
.
Round
(
yPeopleNum
/
3
,
2
,
MidpointRounding
.
AwayFromZero
);
mmodel
.
MAvgPeopleNum
=
Math
.
Round
(
yPeopleNum
/
3
,
2
,
MidpointRounding
.
AwayFromZero
);
...
@@ -3136,7 +3145,8 @@ namespace Mall.Module.MarketingCenter
...
@@ -3136,7 +3145,8 @@ namespace Mall.Module.MarketingCenter
}
}
#
endregion
#
endregion
if
(
SYear
==
endYear
)
{
if
(
SYear
==
endYear
)
{
break
;
break
;
}
}
SYear
=
Convert
.
ToDateTime
(
SYear
+
"-01-01"
).
AddYears
(
1
).
Year
;
SYear
=
Convert
.
ToDateTime
(
SYear
+
"-01-01"
).
AddYears
(
1
).
Year
;
...
@@ -3147,9 +3157,11 @@ namespace Mall.Module.MarketingCenter
...
@@ -3147,9 +3157,11 @@ namespace Mall.Module.MarketingCenter
List
<
User_Statistics_Query
>
YearAvgSCList
=
new
List
<
User_Statistics_Query
>();
//年平均统计数据 成长率
List
<
User_Statistics_Query
>
YearAvgSCList
=
new
List
<
User_Statistics_Query
>();
//年平均统计数据 成长率
List
<
User_Statistics_Rate_Query
>
YearRateSCList
=
new
List
<
User_Statistics_Rate_Query
>();
//年成长率统计数据 成长率
List
<
User_Statistics_Rate_Query
>
YearRateSCList
=
new
List
<
User_Statistics_Rate_Query
>();
//年成长率统计数据 成长率
#
region
第一表
#
region
第一表
foreach
(
var
item
in
YearSList
)
{
foreach
(
var
item
in
YearSList
)
{
//第一年没有 从第二年开始
//第一年没有 从第二年开始
if
(
item
.
Date
!=
startYear
.
ToString
())
{
if
(
item
.
Date
!=
startYear
.
ToString
())
{
int
PreYear
=
Convert
.
ToInt32
(
item
.
Date
)
-
1
;
int
PreYear
=
Convert
.
ToInt32
(
item
.
Date
)
-
1
;
var
PreModel
=
YearSList
.
Where
(
x
=>
x
.
Date
==
PreYear
.
ToString
()).
FirstOrDefault
();
var
PreModel
=
YearSList
.
Where
(
x
=>
x
.
Date
==
PreYear
.
ToString
()).
FirstOrDefault
();
User_Statistics_Query_V2
cmodel
=
new
User_Statistics_Query_V2
()
{
Date
=
item
.
Date
+
"成長率"
};
User_Statistics_Query_V2
cmodel
=
new
User_Statistics_Query_V2
()
{
Date
=
item
.
Date
+
"成長率"
};
...
...
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