Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in
Toggle navigation
T
tamp_course_order
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
彭熊
tamp_course_order
Commits
38a95e39
Commit
38a95e39
authored
Apr 23, 2021
by
etscript
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
77a324b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletion
+17
-1
order.py
app/controller/order.py
+2
-0
order_service.py
app/service/order_service.py
+15
-1
No files found.
app/controller/order.py
View file @
38a95e39
...
@@ -97,6 +97,8 @@ class ConsumeOrder(Resource):
...
@@ -97,6 +97,8 @@ class ConsumeOrder(Resource):
self
.
parser
.
add_argument
(
'ab_pro_siid'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'ab_pro_siid'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'openid'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'openid'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'register_phone'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'register_phone'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'ad'
,
type
=
str
,
required
=
False
)
self
.
parser
.
add_argument
(
'ad_id'
,
type
=
str
,
required
=
False
)
args
=
self
.
parser
.
parse_args
()
args
=
self
.
parser
.
parse_args
()
if
request
.
headers
.
get
(
'env'
)
in
[
'ios'
,
'android'
]:
if
request
.
headers
.
get
(
'env'
)
in
[
'ios'
,
'android'
]:
...
...
app/service/order_service.py
View file @
38a95e39
...
@@ -35,6 +35,8 @@ course_price_api = "http://s-nginx/course/res/money/price"
...
@@ -35,6 +35,8 @@ course_price_api = "http://s-nginx/course/res/money/price"
course_rollback_api
=
"http://s-nginx/fatools/pay/course/rollback"
course_rollback_api
=
"http://s-nginx/fatools/pay/course/rollback"
ad_course_rollback_api
=
"http://s-nginx/course/advertise/detail?id="
class
TopUpOrderService
:
class
TopUpOrderService
:
""""""
""""""
def
__init__
(
self
):
def
__init__
(
self
):
...
@@ -257,7 +259,19 @@ class CurriculumOrderService:
...
@@ -257,7 +259,19 @@ class CurriculumOrderService:
OrderFlow
.
ab_status
==
'SUCCESS'
)
.
all
()
OrderFlow
.
ab_status
==
'SUCCESS'
)
.
all
()
if
repeat_buy
:
if
repeat_buy
:
raise
CustomFlaskErr
(
Errors
.
REPEAT_BUY
)
raise
CustomFlaskErr
(
Errors
.
REPEAT_BUY
)
if
args
[
'ab_type'
]
==
300
:
if
args
[
'ab_type'
]
==
300
and
args
.
get
(
'ad'
)
==
'April'
:
amount
=
requests
.
get
(
ad_course_price_api
+
args
.
get
(
'ad_id'
),
timeout
=
5
)
try
:
amount
=
amount
.
json
()
amount
=
[
float
(
amount
[
"attributes"
][
"bargainPrice"
])
/
100
]
except
:
raise
CustomFlaskErr
(
Errors
.
PROD_NOPRICE
)
args
.
pop
(
'ad'
,
''
)
args
.
pop
(
'ad_id'
,
''
)
elif
args
[
'ab_type'
]
==
300
:
data
=
{
data
=
{
"payReqs"
:
[{
"resId"
:
args
[
'ab_proid'
]}],
"payReqs"
:
[{
"resId"
:
args
[
'ab_proid'
]}],
"userId"
:
args
[
'user_id'
]
"userId"
:
args
[
'user_id'
]
...
...
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