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
f25135d2
Commit
f25135d2
authored
Apr 22, 2021
by
etscript
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
全部订单添加课程附件305
parent
adea982a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
order_service.py
app/service/order_service.py
+7
-2
No files found.
app/service/order_service.py
View file @
f25135d2
...
...
@@ -511,11 +511,11 @@ def getAllOrders(args):
# 找出 1栏目表 , 3直播间信息表, [4,5]课程资源, 7附件 的list id
orders
=
[
r
.
to_dict
()
for
r
in
res
if
r
.
to_dict
()[
'ab_status'
]
==
'SUCCESS'
]
orders_dict
=
{
'1'
:[],
'3'
:[],
'4'
:[],
'5'
:[],
'7'
:[],
'300'
:[]}
orders_dict
=
{
'1'
:[],
'3'
:[],
'4'
:[],
'5'
:[],
'7'
:[],
'300'
:[]
,
'305'
:[]
}
for
i
in
orders
:
prod_type
=
i
.
get
(
'ab_type'
,
''
)
prod_id
=
i
.
get
(
'ab_proid'
,
''
)
if
(
prod_type
in
'13457'
or
prod_type
==
'300'
)
and
prod_id
:
if
(
prod_type
in
'13457'
or
prod_type
==
'300'
or
prod_type
==
'305'
)
and
prod_id
:
orders_dict
[
prod_type
]
.
append
(
prod_id
)
# 四组组合查询,将 需要的 1栏目表 , 3直播间信息表, [4,5]课程资源, 7附件, 300 课程包 查出
...
...
@@ -534,6 +534,8 @@ def getAllOrders(args):
CoursePackage
.
square_img
,
CoursePackage
.
bg_status
,
CoursePackage
.
bg_img
)
.
\
filter
(
CoursePackage
.
id
.
in_
(
orders_dict
[
"300"
]))
.
all
()
course_file
=
tamp_user_session
.
query
(
CsFileRecord
.
guid
,
CsFileRecord
.
original_name
)
.
\
filter
(
CsFileRecord
.
guid
.
in_
(
orders_dict
[
"305"
]))
.
all
()
curriculum_column
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
]}
for
r
in
curriculum_column
}
...
...
@@ -541,6 +543,7 @@ def getAllOrders(args):
zhibo
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
],
'zb_start_time'
:
int
(
r
[
4
]
.
timestamp
())
if
r
[
4
]
else
0
}
for
r
in
zhibo
}
zhibo_file
=
{
r
[
0
]:
{
'title'
:
r
[
1
]}
for
r
in
zhibo_file
}
course_package
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'square_img'
:
r
[
2
],
'bg_status'
:
r
[
3
],
'bg_img'
:
r
[
4
]}
for
r
in
course_package
}
course_file
=
{
r
[
0
]:
{
'title'
:
r
[
1
]}
for
r
in
course_file
}
allowed
=
{
'id'
,
'title'
,
'cover'
,
'info'
,
'ab_type'
,
'ab_payment'
,
'ab_score'
,
'ab_pay_mode'
,
'ab_ordernum'
,
'transaction_serial_no'
,
'pay_method'
,
'createtime'
,
'pay_time'
,
'complete_time'
,
...
...
@@ -560,6 +563,8 @@ def getAllOrders(args):
order
=
{
**
order
,
**
zhibo_file
.
get
(
prod_id
,
None
)}
elif
prod_type
==
'300'
and
course_package
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
course_package
.
get
(
prod_id
,
None
)}
elif
prod_type
==
'305'
and
course_file
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
course_file
.
get
(
prod_id
,
None
)}
# 将多余字段删除
keys
=
set
(
order
.
keys
())
-
allowed
...
...
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