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
284223c6
Commit
284223c6
authored
Sep 10, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
37a919f2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
6 deletions
+25
-6
common.js
app/service/credit/common.js
+1
-1
order.js
app/service/credit/order.js
+24
-5
No files found.
app/service/credit/common.js
View file @
284223c6
...
...
@@ -118,7 +118,7 @@ class CommonService extends Service {
return
ret
;
}
async
alipay
()
{
async
alipay
()
{
//TODO
}
...
...
app/service/credit/order.js
View file @
284223c6
...
...
@@ -77,10 +77,29 @@ class OrderService extends Service {
}
async
updateOrderPr
eferential
(
)
{
async
updateOrderPr
ice
(
order_id
)
{
const
{
ctx
}
=
this
;
await
this
.
getPreferential
();
const
user_id
=
ctx
.
userId
;
const
order
=
await
ctx
.
service
.
credit
.
common
.
getOrderInfo
(
order_id
);
if
(
!
order
||
!
order
.
id
)
{
ctx
.
failed
(
'error order'
);
}
const
type_obj
=
{
1
:
'blacklistk'
,
2
:
'callrisk'
,
}
const
type
=
type_obj
[
order
.
type
];
const
preferential
=
await
this
.
getPreferential
(
type
);
let
preferential_price
=
0
;
if
(
preferential
&&
preferential
.
id
)
{
preferential_price
=
preferential
.
price
;
}
const
price
=
order
.
price
-
preferential_price
;
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
price
,
preferential_price
,
preferential_id
:
preferential
.
id
},
{
where
:
{
id
:
order
.
id
}
});
return
true
;
}
...
...
@@ -152,13 +171,13 @@ class OrderService extends Service {
const
preferential
=
await
this
.
getPreferential
(
order
.
type
);
let
preferential_price
=
0
;
let
preferential_title
=
''
;
if
(
!
preferential
||
!
preferential
.
id
)
{
if
(
preferential
&&
preferential
.
id
)
{
preferential_price
=
preferential
.
price
;
preferential_title
=
preferential
.
title
;
}
const
price
=
order
.
price
-
preferential_price
;
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
price
,
preferential_price
,
preferential_id
:
preferential
.
id
},
{
where
:
{
id
:
order
.
id
}
});
await
ctx
.
prometheusModel
.
CreditOrder
.
update
({
price
,
preferential_price
,
preferential_id
:
preferential
.
id
},
{
where
:
{
id
:
order
.
id
,
pay_status
:
0
}
});
const
type_obj
=
{
1
:
'blacklist'
,
...
...
@@ -257,7 +276,7 @@ class OrderService extends Service {
async
unifiedOrder
(
type
,
order_id
)
{
const
{
ctx
}
=
this
;
const
order
=
await
ctx
.
service
.
credit
.
order
.
getOrderInfo
(
order_id
);
if
(
order
&&
order
.
pay_status
===
1
)
{
ctx
.
failed
(
'订单已支付无需重复支付'
);
...
...
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