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
0237f14f
Commit
0237f14f
authored
Apr 21, 2020
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
home
parent
ef53fe4e
Pipeline
#21974
passed with stage
in 2 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
user.js
app/service/user.js
+3
-3
No files found.
app/service/user.js
View file @
0237f14f
...
...
@@ -104,7 +104,7 @@ class UserService extends Service {
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
lastday_data
=
await
ctx
.
dataModel
.
Yz
B
illCost
.
findOne
({
const
lastday_data
=
await
ctx
.
dataModel
.
Yz
b
illCost
.
findOne
({
attributes
:
[
[
ctx
.
model
.
fn
(
'SUM'
,
'pull_volumn'
),
'amount'
],
[
ctx
.
model
.
fn
(
'SUM'
,
'cost'
),
'cost'
],
...
...
@@ -114,14 +114,14 @@ class UserService extends Service {
lastday_info
.
use_amount
=
lastday_data
.
amount
||
0
;
lastday_info
.
use_money
=
lastday_data
.
cost
||
0
;
const
left_money
=
await
ctx
.
dataModel
.
Yz
B
illBalance
.
findOne
({
const
left_money
=
await
ctx
.
dataModel
.
Yz
b
illBalance
.
findOne
({
attributes
:
[
'balance_fn'
],
where
:
{
user_id
,
month
:
last_month
},
})
lastday_info
.
left_money
=
left_money
.
balance_fn
||
0
;
const
detail
=
[]
const
bill
=
await
ctx
.
dataModel
.
Yz
B
illBalance
.
findAll
({
const
bill
=
await
ctx
.
dataModel
.
Yz
b
illBalance
.
findAll
({
attributes
:
[
'month'
,
'company'
,
'balance_bg'
,
'recharge_m'
,
'cost_m'
,
'balance_fn'
],
where
:
{
user_id
},
order
:
[[
'month'
,
'DESC'
]],
...
...
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