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
3869d967
Commit
3869d967
authored
Sep 27, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of t-git.51gjj.com:fangbin/51business
parents
ac7820d8
0cb2faf0
Pipeline
#14346
passed with stage
in 6 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
order.js
app/service/credit/order.js
+5
-5
config.prod.js
config/config.prod.js
+4
-4
No files found.
app/service/credit/order.js
View file @
3869d967
...
@@ -61,18 +61,18 @@ class OrderService extends Service {
...
@@ -61,18 +61,18 @@ class OrderService extends Service {
async
updateOrderStateToOverdue
(
order
)
{
async
updateOrderStateToOverdue
(
order
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
{
id
,
order_time
,
state
,
pay_status
}
=
order
;
let
{
id
,
order_time
,
state
,
pay_status
,
state_time
}
=
order
;
if
(
!
id
||
!
order_time
||
!
state
||
typeof
(
pay_status
)
===
'undefined'
)
{
if
(
!
id
||
!
order_time
||
!
state
||
typeof
(
pay_status
)
===
'undefined'
)
{
return
order
;
return
order
;
}
}
const
expire_time
=
moment
(
order_time
).
valueOf
()
+
24
*
3600
*
1000
;
const
expire_time
=
moment
(
order_time
).
valueOf
()
+
24
*
3600
*
1000
;
const
now_time
=
moment
().
valueOf
();
const
now_time
=
moment
().
valueOf
();
const
state_time
=
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
);
if
([
'支付中'
].
includes
(
state
)
&&
moment
(
state_time
).
valueOf
()
+
300
<
now_time
)
{
if
(
state
===
'支付中'
&&
pay_status
===
0
&&
moment
(
order_time
).
valueOf
()
*
300
<
now_time
)
{
await
this
.
logOrder
(
id
);
await
this
.
logOrder
(
id
);
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
state
:
'待支付'
,
state_time
:
state_time
},
{
where
:
{
id
}
});
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
state
:
'待支付'
,
state_time
:
state_time
},
{
where
:
{
id
}
});
}
}
if
(
expire_time
<
now_time
&&
(
state
===
'待支付'
||
state
===
'已取消'
||
state
===
'支付中'
)
&&
pay_status
===
0
)
{
state_time
=
moment
().
format
(
'YYYY-MM-DD HH:mm:ss'
);
if
(
expire_time
<
now_time
&&
[
'待支付'
,
'已取消'
,
'支付中'
].
includes
(
state
))
{
await
this
.
logOrder
(
id
);
await
this
.
logOrder
(
id
);
const
ret
=
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
state
:
'已失效'
,
state_time
:
state_time
},
{
where
:
{
id
}
});
const
ret
=
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
state
:
'已失效'
,
state_time
:
state_time
},
{
where
:
{
id
}
});
if
(
ret
&&
ret
[
0
])
{
if
(
ret
&&
ret
[
0
])
{
...
@@ -210,7 +210,7 @@ class OrderService extends Service {
...
@@ -210,7 +210,7 @@ class OrderService extends Service {
const
price
=
await
this
.
updateOrderPrice
(
order
);
const
price
=
await
this
.
updateOrderPrice
(
order
);
const
type
=
order
.
type
;
const
type
=
order
.
type
;
const
countdown
=
moment
(
order
.
state
_time
).
format
(
'X'
)
-
moment
(
new
Date
()).
format
(
'X'
)
+
86400
;
const
countdown
=
moment
(
order
.
order
_time
).
format
(
'X'
)
-
moment
(
new
Date
()).
format
(
'X'
)
+
86400
;
const
ret
=
{
const
ret
=
{
price
,
price
,
original_price
:
order
.
price
,
original_price
:
order
.
price
,
...
...
config/config.prod.js
View file @
3869d967
...
@@ -150,13 +150,13 @@ module.exports = appInfo => {
...
@@ -150,13 +150,13 @@ module.exports = appInfo => {
//我的信用-通化检测
//我的信用-通化检测
config
.
YYS_APP_KEY
=
process
.
env
.
YYS_APP_KEY
;
config
.
YYS_APP_KEY
=
process
.
env
.
YYS_APP_KEY
;
config
.
YYS_APPLY_APPSECRET
=
'a695e9b3c0f1e3f15fb0b958fd3a4b67'
;
config
.
YYS_APPLY_APPSECRET
=
process
.
env
.
YYS_APPLY_APPSECRET
;
//运营商报告
//运营商报告
config
.
YYS_REPORT_KEY
=
'F4E0CA710F484CFFB1756741696E29A3'
;
config
.
YYS_REPORT_KEY
=
process
.
env
.
YYS_REPORT_KEY
;
config
.
YYS_REPORT_APPSECRET
=
'233B8E10E31B4C899EE6FEB3AEC22F140B6528BF'
;
config
.
YYS_REPORT_APPSECRET
=
process
.
env
.
YYS_REPORT_APPSECRET
;
config
.
YYS_REPORT_URL
=
'http://47.96.253.64:8049/mycredit/thxdReport'
;
config
.
YYS_REPORT_URL
=
process
.
env
.
YYS_REPORT_URL
;
return
config
;
return
config
;
};
};
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