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
75132aad
Commit
75132aad
authored
Dec 12, 2020
by
pengxiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
直播查询
parent
eba26a18
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
488 additions
and
24 deletions
+488
-24
engine.py
app/api/engine.py
+15
-15
config.yaml
app/config/config.yaml
+4
-2
tamp_zhibo_models.py
app/model/tamp_zhibo_models.py
+450
-0
order_service.py
app/service/order_service.py
+19
-7
No files found.
app/api/engine.py
View file @
75132aad
...
...
@@ -36,21 +36,6 @@ tamp_user_engine = create_engine(
pool_timeout
=
5
,
pool_recycle
=
600
)
if
env
==
'prod'
:
tamp_user_engine
=
create_engine
(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
db
=
config
[
env
][
'MySQL'
][
'tamp_user_db'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
user
=
config
[
env
][
'MySQL'
][
'user2'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
),
max_overflow
=
0
,
# 超过连接池大小外最多创建的连接
pool_size
=
100
,
# 连接池大小
pool_timeout
=
5
,
pool_recycle
=
600
)
tamp_pay_engine
=
create_engine
(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
...
...
@@ -66,6 +51,21 @@ tamp_pay_engine = create_engine(
pool_recycle
=
600
)
tamp_zhibo_engine
=
create_engine
(
'mysql+pymysql://{user}:{password}@{host}:{port}/{db}?charset={charset}'
.
format
(
db
=
config
[
env
][
'MySQL'
][
'tamp_zhibo_db'
],
host
=
config
[
env
][
'MySQL'
][
'host'
],
port
=
config
[
env
][
'MySQL'
][
'port'
],
user
=
config
[
env
][
'MySQL'
][
'user'
],
password
=
config
[
env
][
'MySQL'
][
'password'
],
charset
=
"utf8"
),
max_overflow
=
0
,
# 超过连接池大小外最多创建的连接
pool_size
=
100
,
# 连接池大小
pool_timeout
=
5
,
pool_recycle
=
600
)
redis
=
redis
.
Redis
(
host
=
config
[
env
][
'redis'
][
'host'
],
port
=
config
[
env
][
'redis'
][
'port'
],
...
...
app/config/config.yaml
View file @
75132aad
...
...
@@ -2,6 +2,7 @@ dev:
MySQL
:
tamp_user_db
:
tamp_user
tamp_pay_db
:
tamp_pay
tamp_zhibo_db
:
tamp_zhibo
host
:
mysql
port
:
3306
user
:
dev
...
...
@@ -24,6 +25,7 @@ test:
MySQL
:
tamp_user_db
:
tamp_user
tamp_pay_db
:
tamp_pay
tamp_zhibo_db
:
tamp_zhibo
host
:
118.190.63.109
port
:
3306
user
:
root
...
...
@@ -46,10 +48,10 @@ prod:
MySQL
:
tamp_user_db
:
tamp_user
tamp_pay_db
:
tamp_pay
tamp_zhibo_db
:
tamp_zhibo
host
:
pc-uf666afrpfg8yj768.rwlb.rds.aliyuncs.com
port
:
3306
user
:
tamp_pay
user2
:
tamp_user
user
:
tamp_admin
password
:
'
@imeng123'
redis
:
host
:
r-uf6atruhdbq89enqz0.redis.rds.aliyuncs.com
...
...
app/model/tamp_zhibo_models.py
0 → 100644
View file @
75132aad
# coding: utf-8
from
sqlalchemy
import
Column
,
DateTime
,
Float
,
Index
,
String
,
TIMESTAMP
,
Text
,
text
from
sqlalchemy.dialects.mysql
import
BIGINT
,
INTEGER
,
VARCHAR
from
sqlalchemy.ext.declarative
import
declarative_base
from
app.model.base
import
Base
,
BaseModel
class
ZhiboAppointTask
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_appoint_task'
__table_args__
=
{
'comment'
:
'预约任务'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'主键id'
)
theme_id
=
Column
(
String
(
64
),
nullable
=
False
,
index
=
True
,
comment
=
'直播间id'
)
parent_id
=
Column
(
String
(
64
),
index
=
True
,
comment
=
'母直播间id'
)
begin_time
=
Column
(
TIMESTAMP
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
),
comment
=
'开始时间'
)
type
=
Column
(
INTEGER
(
3
),
nullable
=
False
,
comment
=
'1:直播预约提醒 2:直播全员推送提醒'
)
statut
=
Column
(
INTEGER
(
3
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'状态 0:未发送 1:已发送'
)
create_time
=
Column
(
TIMESTAMP
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
),
comment
=
'创建时间'
)
update_time
=
Column
(
TIMESTAMP
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
),
comment
=
'修改时间'
)
deletetag
=
Column
(
INTEGER
(
3
),
server_default
=
text
(
"'0'"
),
comment
=
'删除标识 0:未删除 1:已删除'
)
class
ZhiboBlack
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_black'
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zb_user_id
=
Column
(
String
(
64
),
comment
=
'用户id'
)
zb_theme_id
=
Column
(
String
(
64
),
comment
=
'主题ID'
)
zb_room_num
=
Column
(
String
(
64
),
comment
=
'直播房间号'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
delete_tag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
class
ZhiboExam
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_exam'
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
ze_themeid
=
Column
(
String
(
64
),
comment
=
'主题ID'
)
ze_teaid
=
Column
(
String
(
64
),
comment
=
'老师ID'
)
ze_title
=
Column
(
String
(
128
),
comment
=
'题目'
)
ze_options
=
Column
(
String
(
2048
),
comment
=
'选项'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
class
ZhiboExamAnswer
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_exam_answer'
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zs_themeid
=
Column
(
String
(
64
),
comment
=
'主题ID'
)
zs_msg
=
Column
(
String
(
64
),
comment
=
'消息ID'
)
zs_userid
=
Column
(
String
(
64
),
comment
=
'用户ID'
)
zs_answer
=
Column
(
String
(
64
),
comment
=
'选择答案'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
class
ZhiboFile
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_file'
__table_args__
=
{
'comment'
:
'直播附件表'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zf_themeid
=
Column
(
String
(
32
),
comment
=
'主题ID'
)
zf_url
=
Column
(
String
(
256
),
comment
=
'附件地址'
)
zf_file_type
=
Column
(
String
(
3
),
server_default
=
text
(
"'1'"
),
comment
=
'上传类型 1直播间附件,2直播间图片 ,3直播间转码视频,4直播间转码音频,5直播间原始视频,6直播间原始音频,7讲师本地上传图片,8用户头像,9问卷图片,10 直播间课件'
)
zf_use
=
Column
(
String
(
3
),
comment
=
'用途'
)
zf_no
=
Column
(
INTEGER
(
3
),
server_default
=
text
(
"'1'"
),
comment
=
'序号'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
server_default
=
text
(
"'0'"
),
comment
=
'删除标识'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
file_ext
=
Column
(
String
(
10
),
comment
=
'文件扩展名'
)
file_size
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'文件大小'
)
file_md5
=
Column
(
String
(
32
),
comment
=
'文件Md5'
)
remark
=
Column
(
String
(
100
),
comment
=
'备注 文件名'
)
status
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'文件状态 0:未完成,1:已完成'
)
task_id
=
Column
(
String
(
64
),
comment
=
'阿里云异步转换id'
)
cs_file_id
=
Column
(
String
(
64
),
comment
=
'filerecord记录id'
)
file_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'附件总页数 用于转换图片使用'
)
class
ZhiboFileBrowse
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_file_browse'
__table_args__
=
{
'comment'
:
'附件浏览记录表'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'主键id'
)
user_id
=
Column
(
String
(
64
),
comment
=
'用户id'
)
zb_id
=
Column
(
String
(
64
),
index
=
True
,
comment
=
'直播id'
)
file_id
=
Column
(
String
(
64
),
nullable
=
False
,
index
=
True
,
comment
=
'附件id'
)
remark
=
Column
(
String
(
100
),
comment
=
'备注'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
VARCHAR
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
VARCHAR
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
VARCHAR
(
3
),
server_default
=
text
(
"'0'"
),
comment
=
'删除标识'
)
class
ZhiboHost
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_host'
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zh_roomnum
=
Column
(
String
(
32
),
comment
=
'直播房间号'
)
zh_status
=
Column
(
String
(
3
),
comment
=
'直播状态'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
zh_room_name
=
Column
(
String
(
64
),
comment
=
'直播房间名称'
)
class
ZhiboInvitationCode
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_invitation_code'
__table_args__
=
(
Index
(
'ziu_theme_id'
,
'ziu_theme_id'
,
'ziu_userid'
,
unique
=
True
),
{
'comment'
:
'邀请码'
}
)
id
=
Column
(
String
(
64
),
primary_key
=
True
)
ziu_theme_id
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'直播主题ID'
)
ziu_userid
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'用户ID'
)
invitation_code
=
Column
(
String
(
64
),
nullable
=
False
,
unique
=
True
,
comment
=
'邀请码'
)
create_time
=
Column
(
DateTime
,
nullable
=
False
,
server_default
=
text
(
"CURRENT_TIMESTAMP"
))
class
ZhiboInvitationLink
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_invitation_link'
id
=
Column
(
String
(
64
),
primary_key
=
True
)
zb_id
=
Column
(
String
(
64
),
nullable
=
False
,
index
=
True
,
comment
=
'直播间id'
)
invite_user_id
=
Column
(
String
(
64
),
comment
=
'邀请人id'
)
link
=
Column
(
String
(
500
),
comment
=
'邀请链接'
)
invited_user_id
=
Column
(
String
(
64
),
comment
=
'被邀请人id'
)
create_time
=
Column
(
TIMESTAMP
,
server_default
=
text
(
"CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP"
),
comment
=
'创建时间'
)
invited_time
=
Column
(
TIMESTAMP
)
expire_time
=
Column
(
TIMESTAMP
)
deletetag
=
Column
(
String
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'删除状态 0:正常 1:失效'
)
class
ZhiboInviteUser
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_invite_users'
__table_args__
=
(
Index
(
'unique_pk_1'
,
'ziu_theme_id'
,
'ziu_userid'
,
unique
=
True
),
)
id
=
Column
(
String
(
64
),
primary_key
=
True
,
server_default
=
text
(
"''"
),
comment
=
'唯一主键'
)
ziu_theme_id
=
Column
(
String
(
64
),
comment
=
'直播主题ID'
)
ziu_userid
=
Column
(
String
(
64
),
comment
=
'用户ID'
)
ziu_username
=
Column
(
String
(
32
),
comment
=
'用户姓名'
)
ziu_phone
=
Column
(
String
(
32
),
comment
=
'用户手机号'
)
inviter_userid
=
Column
(
String
(
64
),
comment
=
'邀请人ID'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
delete_tag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
class
ZhiboManager
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_manager'
__table_args__
=
{
'comment'
:
'直播讲师表'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zm_userid
=
Column
(
String
(
64
),
comment
=
'管理员'
)
zm_roomnum
=
Column
(
String
(
64
),
comment
=
'直播房间号(废弃)'
)
zm_shenfen
=
Column
(
String
(
3
),
comment
=
'管理员身份(0:主持人 1:主讲人)'
)
zm_paixu
=
Column
(
INTEGER
(
3
))
zm_username
=
Column
(
String
(
32
))
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
zb_id
=
Column
(
String
(
64
),
server_default
=
text
(
"''"
),
comment
=
'直播房间id'
)
user_title
=
Column
(
String
(
50
),
comment
=
'直播头衔 '
)
invite_userid
=
Column
(
String
(
64
),
comment
=
'邀请人id (废弃)使用create_by'
)
class
ZhiboMessage
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_message'
__table_args__
=
{
'comment'
:
'直播消息'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zm_content
=
Column
(
String
(
1024
),
comment
=
'消息'
)
zm_themeid
=
Column
(
String
(
64
))
zm_serviceid
=
Column
(
String
(
128
),
comment
=
'微信serviceId'
)
zm_format
=
Column
(
String
(
3
),
index
=
True
,
comment
=
'消息格式'
)
zm_type
=
Column
(
String
(
3
),
index
=
True
,
comment
=
'消息类型 0:普通消息 2:讲师消息 4:助理消息'
)
zm_askid
=
Column
(
String
(
64
),
comment
=
'提问消息ID'
)
zm_roomnum
=
Column
(
String
(
32
),
comment
=
'直播房间号'
)
zm_audiotimelength
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'5'"
))
zm_timesplit
=
Column
(
String
(
3
))
zm_audiotext
=
Column
(
String
(
512
))
zm_status
=
Column
(
String
(
3
),
comment
=
'直播间状态 1:未开始 2:直播中 3:已结束'
)
zm_recordtime
=
Column
(
DateTime
,
index
=
True
)
zm_msg_text
=
Column
(
Text
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
highlighted
=
Column
(
INTEGER
(
3
),
comment
=
'是否是重点'
)
msg_seq
=
Column
(
BIGINT
(
20
),
comment
=
'腾讯消息唯一序列(值越大消息越靠后)'
)
zm_random
=
Column
(
String
(
64
),
comment
=
'腾讯消息32位随机整数'
)
operator_account
=
Column
(
String
(
128
),
comment
=
'腾讯消息请求发起者UserId,可以用来识别是否为管理员请求'
)
group_type
=
Column
(
String
(
64
),
comment
=
'腾讯群组类型(Private| Public| ChatRoom| AVChatRoom)'
)
class
ZhiboPhrase
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_phrase'
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zp_type
=
Column
(
String
(
64
),
comment
=
'类型'
)
zp_content
=
Column
(
String
(
1024
),
comment
=
'内容'
)
zp_sort_num
=
Column
(
INTEGER
(
11
),
comment
=
'排序'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
delete_tag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
class
ZhiboReluser
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_relusers'
__table_args__
=
{
'comment'
:
'直播相关用户'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
)
zt_faid
=
Column
(
String
(
64
),
comment
=
'理财师ID'
)
zt_username
=
Column
(
String
(
32
),
comment
=
'信息收集用户姓名'
)
zr_phone
=
Column
(
String
(
16
),
comment
=
'信息收集用户手机'
)
zr_isfillin
=
Column
(
INTEGER
(
3
),
comment
=
'是否已填写信息表 0:否 1:是'
)
zr_fillin_time
=
Column
(
DateTime
,
comment
=
'用户信息收集时间 '
)
zr_isconsultation
=
Column
(
INTEGER
(
3
),
comment
=
'是否咨询过理财师 0:否 1:是'
)
create_time
=
Column
(
DateTime
,
nullable
=
False
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
delete_tag
=
Column
(
String
(
3
),
nullable
=
False
,
comment
=
'删除标识'
)
class
ZhiboSign
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_sign'
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zs_themeid
=
Column
(
String
(
64
),
comment
=
'主题ID'
)
zs_userid
=
Column
(
String
(
64
),
comment
=
'签到人ID'
)
zs_headimg
=
Column
(
String
(
256
),
comment
=
'签到人头像'
)
zs_uname
=
Column
(
String
(
64
),
comment
=
'签到人姓名'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
class
ZhiboStatInfo
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_stat_info'
__table_args__
=
{
'comment'
:
'直播结束后信息统计'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
)
zb_id
=
Column
(
String
(
64
),
nullable
=
False
,
unique
=
True
,
comment
=
'直播id'
)
top_people
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'峰值人数'
)
total_invited
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'分享人数'
)
new_important_customer
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'新增重点访客'
)
new_first_class_friend
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'新增一级好友'
)
total_advisory
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'累计咨询次数'
)
new_guest
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'新增访客'
)
total_replay
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'回放次数'
)
time
=
Column
(
TIMESTAMP
)
deletetag
=
Column
(
String
(
1
),
server_default
=
text
(
"'0'"
),
comment
=
'删除标志 0:正常 1:删除'
)
class
ZhiboTheme
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_theme'
__table_args__
=
{
'comment'
:
'直播间信息表'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zt_name
=
Column
(
String
(
150
),
comment
=
'主题名称'
)
zt_starttime
=
Column
(
DateTime
,
comment
=
'开播时间'
)
zt_endtime
=
Column
(
DateTime
,
comment
=
'结束时间'
)
zt_desc
=
Column
(
String
(
512
),
comment
=
'描述'
)
zt_roomnum
=
Column
(
String
(
32
),
comment
=
'(废弃)'
)
create_time
=
Column
(
DateTime
,
nullable
=
False
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识 0:正常,1: 删除 2:草稿'
)
zt_status
=
Column
(
String
(
2
),
server_default
=
text
(
"'1'"
),
comment
=
'直播间状态 1未开始,2直播中,3已结束'
)
zt_backimg
=
Column
(
String
(
128
),
comment
=
'直播背景图(废弃)'
)
share_pattern
=
Column
(
INTEGER
(
3
),
comment
=
'分享模式'
)
zt_img
=
Column
(
String
(
128
),
comment
=
'直播封面'
)
zt_iszhibo
=
Column
(
String
(
3
),
comment
=
'是否含直播'
)
zt_proid
=
Column
(
String
(
64
),
comment
=
'关联产品'
)
zt_uname
=
Column
(
String
(
128
),
comment
=
'培训人'
)
zt_flag
=
Column
(
String
(
3
),
comment
=
'参与人开放标识'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
zt_password
=
Column
(
String
(
64
),
comment
=
'密码'
)
zt_label
=
Column
(
String
(
1024
),
comment
=
'直播标签'
)
zt_userids
=
Column
(
Text
,
comment
=
'参与人'
)
zt_mute
=
Column
(
String
(
3
),
comment
=
'是否禁言 0:否 1:是'
)
zt_type
=
Column
(
String
(
64
),
server_default
=
text
(
"'1'"
),
comment
=
'直播类型 1探普之夜,2探普八点半'
)
zt_appointment_nums
=
Column
(
INTEGER
(
8
),
server_default
=
text
(
"'0'"
))
zt_info
=
Column
(
Text
)
zt_qrcode
=
Column
(
String
(
256
))
zt_fuli
=
Column
(
Text
)
zt_cardinal
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'直播基数'
)
zt_isshare
=
Column
(
String
(
3
),
server_default
=
text
(
"'0'"
),
comment
=
'是否可分享'
)
zt_iscollect_userinfo
=
Column
(
String
(
3
),
server_default
=
text
(
"'0'"
),
comment
=
'是否收集用户信息,1收集,0不收集'
)
zt_isverification_phone
=
Column
(
String
(
3
),
server_default
=
text
(
"'0'"
),
comment
=
'是否开启手机号验证'
)
zt_examid
=
Column
(
String
(
128
))
parent_id
=
Column
(
String
(
64
),
index
=
True
,
comment
=
'母直播间id'
)
room_type
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'1'"
),
comment
=
'直播间类型 1母直播间,2子直播间'
)
video_type
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'1'"
),
comment
=
'视屏类型 1视频,2音频'
)
duration_second_show
=
Column
(
Float
(
11
,
True
),
server_default
=
text
(
"'0.00'"
),
comment
=
'直播时长 显示 单位小时'
)
real_start_time
=
Column
(
DateTime
,
comment
=
'实际开始时间'
)
real_end_time
=
Column
(
DateTime
,
comment
=
'真实结束时间'
)
real_duration_second
=
Column
(
INTEGER
(
11
),
comment
=
'直播实际时长'
)
reservation
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'是否可预约 1:需要预约 0:不需要预约'
)
can_broadcast
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'可转播设置 1:可转播 0:不可转播'
)
broadcast_score
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'转播积分'
)
broadcast_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'转播数量'
)
participation_rigth
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'探普云参与权限0:所有人,1仅注册用户,2仅探普会员可进入,3需要密码'
)
replay
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'回放设置 0:不录制 1:录制'
)
opening_remarks
=
Column
(
String
(
200
),
comment
=
'开场白'
)
user_title
=
Column
(
String
(
20
),
comment
=
'直播间头衔'
)
guest_greetings
=
Column
(
String
(
200
),
comment
=
'访客问候语'
)
guest_card
=
Column
(
String
(
2
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'是否给访客发送名片(0不发送 1发送) (-针对理财师)'
)
guest_we_shop
=
Column
(
String
(
2
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'是否给访客发送微店(0不发送 1发送) (-针对理财师)'
)
friend_greetings
=
Column
(
String
(
200
),
comment
=
'一级好友问候语'
)
friend_card
=
Column
(
String
(
2
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'是否给好友发送微店(0不发送 1发送) (-针对理财师)'
)
friend_we_shop
=
Column
(
String
(
2
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'是否给好友发送微店(0不发送 1发送) (-针对理财师)'
)
recommend_home_page
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'推荐到微店首页 1:可推荐 0:不可推荐'
)
recommend_time
=
Column
(
DateTime
,
comment
=
'推荐到首页的时间'
)
participants_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'参与人数'
)
online_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'在线人数'
)
reservation_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'预约人数'
)
information_sheet_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'已填信息表人数'
)
replay_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'回放人数'
)
sms_template_id
=
Column
(
String
(
32
),
comment
=
'短信模板id'
)
manager_name
=
Column
(
String
(
100
),
comment
=
'主讲人描述,用于直播间主讲人描述'
)
recommend_home_tanpu
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'推荐到探普学堂首页 1:推荐 0:不推荐'
)
recommend_time_tanpu
=
Column
(
DateTime
,
comment
=
'推荐首页(探普学堂)推荐时间'
)
participants_pv
=
Column
(
INTEGER
(
11
),
comment
=
'参数人次 统计pv'
)
participants_child_pv
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'子直播间参与人数总计'
)
isPrivacy
=
Column
(
INTEGER
(
3
),
comment
=
'是否隐私直播间0否1是'
)
iscreate_group_success
=
Column
(
INTEGER
(
3
),
server_default
=
text
(
"'0'"
),
comment
=
'是否已创建群组 0:否 1:是'
)
max_online_num
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'在线人数峰值'
)
tags
=
Column
(
String
(
255
),
comment
=
'标签'
)
class
ZhiboUserAction
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_user_action'
__table_args__
=
(
Index
(
'zu_themdid'
,
'zu_themdid'
,
'zu_uid'
,
'zu_type'
),
{
'comment'
:
'直播用户行为记录表'
}
)
id
=
Column
(
String
(
64
),
primary_key
=
True
)
zu_themdid
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'主题ID'
)
zu_uid
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'人员ID'
)
zu_type
=
Column
(
String
(
5
),
nullable
=
False
,
index
=
True
,
comment
=
'行为类型:1分享2回放...'
)
sundry
=
Column
(
String
(
2000
),
comment
=
'存储不同行为的杂项信息'
)
create_time
=
Column
(
DateTime
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
deletetag
=
Column
(
String
(
3
),
comment
=
'删除标识'
)
class
ZhiboUserPlayRecord
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_user_play_record'
__table_args__
=
{
'comment'
:
'直播播放记录'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'主键'
)
zb_id
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'直播间id'
)
user_id
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'用户id'
)
zb_status
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
comment
=
'直播状态:2直播中,3已结束'
)
play_start_time
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
comment
=
'播放开始时间(秒)'
)
play_duration
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
comment
=
'播放时长'
)
create_time
=
Column
(
DateTime
,
nullable
=
False
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
nullable
=
False
,
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
INTEGER
(
11
),
nullable
=
False
,
server_default
=
text
(
"'0'"
),
comment
=
'删除标识'
)
class
ZhiboUser
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_users'
__table_args__
=
(
Index
(
'zhibo_users_pk'
,
'zu_themdid'
,
'zu_uid'
,
unique
=
True
),
{
'comment'
:
'直播用户表'
}
)
id
=
Column
(
String
(
64
),
primary_key
=
True
,
comment
=
'唯一主键'
)
zu_themdid
=
Column
(
String
(
32
),
nullable
=
False
,
comment
=
'主题ID'
)
zu_uid
=
Column
(
String
(
32
),
nullable
=
False
,
comment
=
'组织或人员ID'
)
zu_type
=
Column
(
String
(
3
),
comment
=
'类型'
)
zu_fullpath
=
Column
(
String
(
512
))
create_time
=
Column
(
DateTime
,
index
=
True
,
comment
=
'创建时间'
)
create_by
=
Column
(
String
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
String
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
String
(
3
),
index
=
True
,
comment
=
'删除标识'
)
org_id
=
Column
(
String
(
64
),
comment
=
'机构ID'
)
appointment_time
=
Column
(
TIMESTAMP
,
comment
=
'预约时间'
)
shie_id
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'屏蔽 0:不屏蔽 1:屏蔽'
)
no_talking
=
Column
(
INTEGER
(
5
),
server_default
=
text
(
"'0'"
),
comment
=
'禁止发言 0:不禁止 1:禁止'
)
invite_userid
=
Column
(
String
(
64
),
comment
=
'邀请人id'
)
entry_time
=
Column
(
TIMESTAMP
,
index
=
True
,
comment
=
'首次进入房间时间'
)
total_zhibo_seconds
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'累计直播市场 秒'
)
total_in_times
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'累计进入次数'
)
entry_before_start
=
Column
(
INTEGER
(
2
),
comment
=
'是否直播前进入过房间 0:不是,1:是'
)
online_between_zhibo
=
Column
(
INTEGER
(
2
),
server_default
=
text
(
"'0'"
),
comment
=
'直播过程中是否在线 0:不是 1:是'
)
entry_between_zhibo
=
Column
(
INTEGER
(
2
),
server_default
=
text
(
"'0'"
),
comment
=
'是否直播中进入过房间 0:不是 1:是'
)
entry_after_zhibo
=
Column
(
INTEGER
(
2
),
server_default
=
text
(
"'0'"
),
comment
=
'是否直播后进入过房间 0不是 1:是'
)
zu_links
=
Column
(
String
(
1024
),
comment
=
'首次进入直播间链路'
)
last_private_chat_time
=
Column
(
DateTime
,
comment
=
'最近私聊消息时间'
)
class
ZhiboUsersOnlineRecord
(
Base
,
BaseModel
):
__tablename__
=
'zhibo_users_online_record'
__table_args__
=
{
'comment'
:
'直播间用户在线状态'
}
id
=
Column
(
String
(
64
),
primary_key
=
True
)
zb_id
=
Column
(
String
(
64
),
index
=
True
,
comment
=
'直播间id'
)
user_id
=
Column
(
String
(
64
),
index
=
True
,
comment
=
'用户id'
)
type
=
Column
(
INTEGER
(
2
),
index
=
True
,
server_default
=
text
(
"'1'"
),
comment
=
'类型 1进入房间,2离开房间'
)
create_time
=
Column
(
DateTime
,
index
=
True
,
comment
=
'创建时间'
)
create_by
=
Column
(
VARCHAR
(
64
),
comment
=
'创建人'
)
update_time
=
Column
(
DateTime
,
comment
=
'修改时间'
)
update_by
=
Column
(
VARCHAR
(
64
),
comment
=
'修改人'
)
deletetag
=
Column
(
VARCHAR
(
3
),
index
=
True
,
server_default
=
text
(
"'0'"
),
comment
=
'删除标识'
)
online_time
=
Column
(
INTEGER
(
11
),
server_default
=
text
(
"'0'"
),
comment
=
'在线时长,当type=2时有值,单位秒'
)
app/service/order_service.py
View file @
75132aad
...
...
@@ -12,7 +12,7 @@ import time
from
sqlalchemy
import
and_
from
sqlalchemy.testing
import
in_
from
app.api.engine
import
TAMP_SQL
,
tamp_pay_engine
,
tamp_user_engine
,
config
,
env
from
app.api.engine
import
TAMP_SQL
,
tamp_pay_engine
,
tamp_user_engine
,
config
,
env
,
tamp_zhibo_engine
from
app.config.errors
import
Errors
from
app.controller.errorhandler
import
CustomFlaskErr
from
app.model.account_balance
import
AccountBalance
...
...
@@ -21,6 +21,7 @@ from app.model.curriculum_order import OrderFlow
from
app.model.tamp_user_models
import
CurriculumPrice
,
CurriculumColumn
,
CurriculumRes
from
xml.etree
import
cElementTree
as
etree
from
app.model.tamp_zhibo_models
import
ZhiboTheme
from
app.utils.alipay.alipayWap
import
prePay
from
app.utils.apple_pay
import
apple_pay
from
app.utils.wxpay
import
wx_jsapi_pay
...
...
@@ -129,10 +130,12 @@ class CurriculumOrderService:
pageSize
=
args
[
'pageSize'
]
user_id
=
args
[
'user_id'
]
offset
=
(
pageNumber
-
1
)
*
pageSize
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
:
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
,
TAMP_SQL
(
tamp_zhibo_engine
)
as
tamp_zhibo
:
tamp_user_session
=
tamp_user
.
session
tamp_zhibo_session
=
tamp_zhibo
.
session
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'
)
)
.
count
()
...
...
@@ -141,6 +144,7 @@ class CurriculumOrderService:
)
.
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
}
zhibo
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
],
'zb_start_time'
:
r
[
4
]}
for
r
in
zhibo
}
orders
=
[
r
.
to_dict
()
for
r
in
res
if
r
.
to_dict
()[
'ab_status'
]
==
'SUCCESS'
]
temp_orders
=
[]
for
order
in
orders
:
...
...
@@ -148,12 +152,14 @@ class CurriculumOrderService:
prod_id
=
order
.
get
(
'ab_proid'
,
''
)
if
prod_type
==
'1'
and
curriculum_column
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
curriculum_column
.
get
(
prod_id
,
None
)}
elif
prod_type
in
[
'3'
,
'4'
,
'5'
]
and
curriculum_res
.
get
(
prod_id
,
None
):
elif
prod_type
==
'3'
and
zhibo
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
zhibo
.
get
(
prod_id
,
None
)}
elif
prod_type
in
[
'4'
,
'5'
]
and
curriculum_res
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
curriculum_res
.
get
(
prod_id
,
None
)}
temp_orders
.
append
(
order
)
temp_orders
=
temp_orders
[
offset
:
offset
+
pageSize
]
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'
,
'ab_status'
,
'ab_pro_siid'
}
'ab_status'
,
'ab_pro_siid'
,
'zb_start_time'
}
for
r
in
temp_orders
:
keys
=
set
(
r
.
keys
())
-
allowed
for
key
in
keys
:
...
...
@@ -361,13 +367,16 @@ def getAllOrders(args):
pageSize
=
args
[
'pageSize'
]
user_id
=
args
[
'user_id'
]
offset
=
(
pageNumber
-
1
)
*
pageSize
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
:
with
TAMP_SQL
(
tamp_user_engine
)
as
tamp_user
,
TAMP_SQL
(
tamp_zhibo_engine
)
as
tamp_zhibo
:
tamp_user_session
=
tamp_user
.
session
tamp_zhibo_session
=
tamp_zhibo
.
session
# 全部订单
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_status
==
'SUCCESS'
)
)
.
count
()
...
...
@@ -376,6 +385,7 @@ def getAllOrders(args):
)
.
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
}
zhibo
=
{
r
[
0
]:
{
'title'
:
r
[
1
],
'cover'
:
r
[
2
],
'info'
:
r
[
3
],
'zb_start_time'
:
r
[
4
]}
for
r
in
zhibo
}
orders
=
[
r
.
to_dict
()
for
r
in
res
if
r
.
to_dict
()[
'ab_status'
]
==
'SUCCESS'
]
temp_orders
=
[]
for
order
in
orders
:
...
...
@@ -383,12 +393,14 @@ def getAllOrders(args):
prod_id
=
order
.
get
(
'ab_proid'
,
''
)
if
prod_type
==
'1'
and
curriculum_column
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
curriculum_column
.
get
(
prod_id
,
None
)}
elif
prod_type
in
[
'3'
,
'4'
,
'5'
]
and
curriculum_res
.
get
(
prod_id
,
None
):
elif
prod_type
==
'3'
and
zhibo
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
zhibo
.
get
(
prod_id
,
None
)}
elif
prod_type
in
[
'4'
,
'5'
]
and
curriculum_res
.
get
(
prod_id
,
None
):
order
=
{
**
order
,
**
curriculum_res
.
get
(
prod_id
,
None
)}
temp_orders
.
append
(
order
)
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'
,
'ab_status'
,
'ab_pro_siid'
}
'ab_status'
,
'ab_pro_siid'
,
'zt_start_time'
}
for
r
in
temp_orders
:
keys
=
set
(
r
.
keys
())
-
allowed
for
key
in
keys
:
...
...
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