Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yizhi_server
Project
Project
Details
Activity
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
data_server
yizhi_server
Commits
6d00090a
Commit
6d00090a
authored
Apr 27, 2020
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
product
parent
8d3649fe
Pipeline
#22315
passed with stage
in 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
user.js
app/service/user.js
+1
-1
userDetail.js
app/service/userDetail.js
+13
-3
No files found.
app/service/user.js
View file @
6d00090a
...
@@ -109,7 +109,7 @@ class UserService extends Service {
...
@@ -109,7 +109,7 @@ class UserService extends Service {
const
last_day
=
moment
(
new
Date
()).
subtract
(
1
,
'day'
).
format
(
'YYYY-MM-DD'
);
const
last_day
=
moment
(
new
Date
()).
subtract
(
1
,
'day'
).
format
(
'YYYY-MM-DD'
);
const
last_month
=
moment
(
new
Date
()).
subtract
(
1
,
'day'
).
format
(
'YYYYMM'
);
const
last_month
=
moment
(
new
Date
()).
subtract
(
1
,
'day'
).
format
(
'YYYYMM'
);
const
lastday_data
=
await
ctx
.
dataModel
.
YzbillCost
.
find
One
({
const
lastday_data
=
await
ctx
.
dataModel
.
YzbillCost
.
find
All
({
attributes
:
[
attributes
:
[
[
ctx
.
dataModel
.
fn
(
'SUM'
,
'pull_volumn'
),
'amount'
],
[
ctx
.
dataModel
.
fn
(
'SUM'
,
'pull_volumn'
),
'amount'
],
[
ctx
.
dataModel
.
fn
(
'SUM'
,
'cost'
),
'cost'
],
[
ctx
.
dataModel
.
fn
(
'SUM'
,
'cost'
),
'cost'
],
...
...
app/service/userDetail.js
View file @
6d00090a
...
@@ -59,8 +59,11 @@ class UserDetailService extends Service {
...
@@ -59,8 +59,11 @@ class UserDetailService extends Service {
let
where
=
{
user_id
};
let
where
=
{
user_id
};
if
(
product
)
{
if
(
product
)
{
ret
.
product
=
product
;
product
=
JSON
.
parse
(
product
);
where
.
service
=
product
;
if
(
product
.
length
>
0
)
{
ret
.
product
=
product
;
where
.
service
=
product
;
}
}
}
const
appKeys
=
await
ctx
.
yizhiModel
.
UserService
.
findAll
({
const
appKeys
=
await
ctx
.
yizhiModel
.
UserService
.
findAll
({
...
@@ -139,7 +142,11 @@ class UserDetailService extends Service {
...
@@ -139,7 +142,11 @@ class UserDetailService extends Service {
let
where
=
{
user_id
};
let
where
=
{
user_id
};
if
(
product
)
{
if
(
product
)
{
where
.
service
=
product
;
product
=
JSON
.
parse
(
product
);
if
(
product
.
length
>
0
)
{
ret
.
product
=
product
;
where
.
service
=
product
;
}
}
}
const
appKeys
=
await
ctx
.
yizhiModel
.
UserService
.
findAll
({
const
appKeys
=
await
ctx
.
yizhiModel
.
UserService
.
findAll
({
...
@@ -154,6 +161,9 @@ class UserDetailService extends Service {
...
@@ -154,6 +161,9 @@ class UserDetailService extends Service {
appList
.
push
(
value
.
appkey
);
appList
.
push
(
value
.
appkey
);
}
}
});
});
if
(
end_date
.
length
===
7
)
{
end_date
=
moment
(
end_date
+
'-01'
).
add
(
1
,
'month'
).
format
(
'YYYY-MM'
);
}
where
=
{
where
=
{
user_id
:
ctx
.
userId
,
user_id
:
ctx
.
userId
,
appKey
:
appList
,
appKey
:
appList
,
...
...
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