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
1b6c9e4f
Commit
1b6c9e4f
authored
Sep 16, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
a888b170
Pipeline
#13780
passed with stage
in 29 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
7 deletions
+4
-7
order.js
app/service/credit/order.js
+4
-7
No files found.
app/service/credit/order.js
View file @
1b6c9e4f
...
...
@@ -42,7 +42,7 @@ class OrderService extends Service {
order_no
:
order
.
order_no
,
report_id
:
order
.
report_id
,
type
:
order_type
,
created_time
:
order
.
created_at
,
created_time
:
moment
(
order
.
created_at
).
format
(
'YYYY-MM-DD HH:mm'
)
,
phone
:
order
.
phone
.
replace
(
order
.
phone
.
substring
(
3
,
7
),
"****"
),
state
:
order
.
state
,
state_text
:
order
.
state
===
'已支付'
?
''
:
order
.
state
,
...
...
@@ -57,7 +57,7 @@ class OrderService extends Service {
return
{
worth_h
,
worth_l
}
}
//更新订单状态
//更新订单状态
为已失效
async
updateOrderStateToOverdue
(
order
)
{
const
{
ctx
}
=
this
;
...
...
@@ -72,7 +72,7 @@ class OrderService extends Service {
// if (state === '支付中' && pay_status === 0 && moment(order.state_time).valueOf() * 300 < now_time) {
// await ctx.prometheusModel.CreditOrder.update({ state: '待支付', state_time: state_time }, { where: { id } });
// }
if
(
expire_time
<
now_time
&&
(
state
===
'待支付'
||
state
===
'已取消'
)
&&
pay_status
===
0
)
{
if
(
expire_time
<
now_time
&&
(
state
===
'待支付'
||
state
===
'已取消'
||
state
===
'支付中'
)
&&
pay_status
===
0
)
{
const
ret
=
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
state
:
'已失效'
,
state_time
:
state_time
},
{
where
:
{
id
}
});
if
(
ret
&&
ret
[
0
])
{
await
this
.
logOrder
(
order
);
...
...
@@ -231,9 +231,6 @@ class OrderService extends Service {
const
{
ctx
}
=
this
;
const
user_id
=
ctx
.
userId
;
const
order
=
await
ctx
.
prometheusModel
.
CreditOrder
.
findOne
({
where
:
{
id
:
order_id
,
user_id
}
});
if
(
order
&&
order
.
pay_status
===
1
)
{
return
true
;
}
if
(
!
order
||
!
order
.
id
)
{
ctx
.
failed
(
'error order'
);
}
...
...
@@ -314,7 +311,7 @@ class OrderService extends Service {
total_fee
:
price
,
notify_url
:
`
${
this
.
config
.
OUT_P_NODE_URL
}
/51business/api/credit/order/wx_pay_notice`
,
product_id
:
order
.
order_no
,
scene_info
:
JSON
.
stringify
({
h5_info
:
{
type
:
'Wap'
,
wap_url
:
this
.
config
.
PHP
_URL
,
wap_name
:
'我的信用'
},
}),
scene_info
:
JSON
.
stringify
({
h5_info
:
{
type
:
'Wap'
,
wap_url
:
this
.
config
.
OUT_P_NODE
_URL
,
wap_name
:
'我的信用'
},
}),
};
const
ret
=
await
ctx
.
service
.
credit
.
common
.
WexinUnifiedOrder
(
data
);
//微信统一下单
...
...
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