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
d120141f
Commit
d120141f
authored
Dec 15, 2020
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信公众号appid配置
parent
259cf47b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
order_service.py
app/service/order_service.py
+32
-8
No files found.
app/service/order_service.py
View file @
d120141f
...
...
@@ -41,8 +41,14 @@ class TopUpOrderService:
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
:
tamp_user_session
=
tamp_user
.
session
totalSize
=
tamp_user_session
.
query
(
OrderFlow
.
id
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
==
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
))
.
count
()
res
=
tamp_user_session
.
query
(
OrderFlow
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
==
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
))
.
order_by
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
==
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
),
OrderFlow
.
deletetag
==
'0'
)
.
count
()
res
=
tamp_user_session
.
query
(
OrderFlow
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
==
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
,
OrderFlow
.
deletetag
==
'0'
)
)
.
order_by
(
OrderFlow
.
createtime
.
desc
())
.
offset
(
offset
)
.
limit
(
pageSize
)
res
=
[
r
.
to_dict
()
for
r
in
res
]
allowed
=
{
'id'
,
'ab_ordernum'
,
'transaction_serial_no'
,
'ab_payment'
,
'ab_pay_mode'
,
'createtime'
,
'pay_time'
,
'complete_time'
,
'ab_type'
}
...
...
@@ -136,11 +142,21 @@ class CurriculumOrderService:
curriculum_column
=
tamp_user_session
.
query
(
CurriculumColumn
.
id
,
CurriculumColumn
.
title
,
CurriculumColumn
.
cover
,
CurriculumColumn
.
info
)
.
all
()
curriculum_res
=
tamp_user_session
.
query
(
CurriculumRes
.
id
,
CurriculumRes
.
title
,
CurriculumRes
.
cover
,
CurriculumRes
.
teacher_name
)
.
all
()
zhibo
=
tamp_zhibo_session
.
query
(
ZhiboTheme
.
id
,
ZhiboTheme
.
zt_name
,
ZhiboTheme
.
zt_img
,
ZhiboTheme
.
manager_name
,
ZhiboTheme
.
zt_starttime
)
.
all
()
totalSize
=
tamp_user_session
.
query
(
OrderFlow
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
!=
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
)
totalSize
=
tamp_user_session
.
query
(
OrderFlow
.
id
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
!=
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
,
OrderFlow
.
deletetag
==
'0'
)
)
.
count
()
res
=
tamp_user_session
.
query
(
OrderFlow
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
!=
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
)
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_type
!=
'6'
,
OrderFlow
.
ab_status
==
'SUCCESS'
,
OrderFlow
.
deletetag
==
'0'
)
)
.
order_by
(
OrderFlow
.
createtime
.
desc
())
.
offset
(
offset
)
.
limit
(
pageSize
)
curriculum_column
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
]}
for
r
in
curriculum_column
}
curriculum_res
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
]}
for
r
in
curriculum_res
}
...
...
@@ -377,11 +393,19 @@ def getAllOrders(args):
CurriculumRes
.
teacher_name
)
.
all
()
zhibo
=
tamp_zhibo_session
.
query
(
ZhiboTheme
.
id
,
ZhiboTheme
.
zt_name
,
ZhiboTheme
.
zt_img
,
ZhiboTheme
.
manager_name
,
ZhiboTheme
.
zt_starttime
)
.
all
()
totalSize
=
tamp_user_session
.
query
(
OrderFlow
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_status
==
'SUCCESS'
)
totalSize
=
tamp_user_session
.
query
(
OrderFlow
.
id
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_status
==
'SUCCESS'
,
OrderFlow
.
deletetag
==
'0'
)
)
.
count
()
res
=
tamp_user_session
.
query
(
OrderFlow
)
.
filter
(
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_status
==
'SUCCESS'
)
and_
(
OrderFlow
.
createby
==
user_id
,
OrderFlow
.
ab_status
==
'SUCCESS'
,
OrderFlow
.
deletetag
==
'0'
)
)
.
order_by
(
OrderFlow
.
createtime
.
desc
())
.
offset
(
offset
)
.
limit
(
pageSize
)
curriculum_column
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
]}
for
r
in
curriculum_column
}
curriculum_res
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
]}
for
r
in
curriculum_res
}
...
...
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