Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
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
方斌
51business
Commits
43c34460
Commit
43c34460
authored
Sep 06, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
6b28adbc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
order.js
app/service/credit/order.js
+5
-1
No files found.
app/service/credit/order.js
View file @
43c34460
...
@@ -58,15 +58,19 @@ class OrderService extends Service {
...
@@ -58,15 +58,19 @@ class OrderService extends Service {
async
getReportValid
(
type
,
reportId
)
{
async
getReportValid
(
type
,
reportId
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
let
valid
=
0
;
let
valid
=
0
;
if
(
!
[
1
,
2
].
includes
(
type
))
{
return
valid
;
}
let
timeLine
=
(
type
===
1
)
?
15
:
30
;
let
orderFilter
=
{
let
orderFilter
=
{
where
:
{
where
:
{
report_id
:
reportId
,
report_id
:
reportId
,
type
:
type
,
valid
:
1
valid
:
1
}
}
};
};
let
orderInfo
=
await
ctx
.
prometheusModel
.
CreditOrder
.
findOne
(
orderFilter
);
let
orderInfo
=
await
ctx
.
prometheusModel
.
CreditOrder
.
findOne
(
orderFilter
);
if
(
orderInfo
!=
null
)
{
if
(
orderInfo
!=
null
)
{
let
timeLine
=
(
type
===
1
)
?
15
:
30
;
if
(
orderInfo
.
state
===
'已支付'
&&
moment
(
orderInfo
.
state_time
).
add
(
timeLine
,
'days'
).
format
(
'YYYY-MM-DD HH:ii:ss'
)
>
moment
().
format
(
'YYYY-MM-DD HH:ii:ss'
))
{
if
(
orderInfo
.
state
===
'已支付'
&&
moment
(
orderInfo
.
state_time
).
add
(
timeLine
,
'days'
).
format
(
'YYYY-MM-DD HH:ii:ss'
)
>
moment
().
format
(
'YYYY-MM-DD HH:ii:ss'
))
{
valid
=
1
;
valid
=
1
;
}
}
...
...
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