Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mancheng
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
mancheng
Commits
9b13a578
Commit
9b13a578
authored
Jan 26, 2022
by
赵宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ab857622
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
apps/models.py
+1
-1
apps/view_atlas/view.py
+1
-1
apps/view_index/view.py
+6
-4
No files found.
apps/models.py
View file @
9b13a578
...
@@ -356,7 +356,7 @@ class Video(db.Model):
...
@@ -356,7 +356,7 @@ class Video(db.Model):
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
,
doc
=
'视频主键id'
,
comment
=
'视频主键id'
)
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
,
doc
=
'视频主键id'
,
comment
=
'视频主键id'
)
district
=
db
.
Column
(
db
.
String
(
32
),
nullable
=
False
,
doc
=
'区县名称'
,
comment
=
'区县名称'
)
district
=
db
.
Column
(
db
.
String
(
32
),
nullable
=
False
,
doc
=
'区县名称'
,
comment
=
'区县名称'
)
# video_id = db.Column(db.String(255), doc='视频url', comment='视频url
')
image_url
=
db
.
Column
(
db
.
String
(
255
),
doc
=
'视频封面'
,
comment
=
'视频封面
'
)
video_id1
=
db
.
Column
(
db
.
String
(
255
),
doc
=
'视频链接'
,
comment
=
'视频链接'
)
video_id1
=
db
.
Column
(
db
.
String
(
255
),
doc
=
'视频链接'
,
comment
=
'视频链接'
)
...
...
apps/view_atlas/view.py
View file @
9b13a578
...
@@ -276,7 +276,7 @@ def get_data(name, industry_level, select_flag, page, perpage):
...
@@ -276,7 +276,7 @@ def get_data(name, industry_level, select_flag, page, perpage):
induzone
=
Induzone
.
query
.
filter
(
Induzone
.
cate
.
like
(
'行政区'
),
Induzone
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)))
induzone
=
Induzone
.
query
.
filter
(
Induzone
.
cate
.
like
(
'行政区'
),
Induzone
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)))
elif
select_flag
==
2
and
industry_level
==
1
:
# 当选择的是父产业的园区时
elif
select_flag
==
2
and
industry_level
==
1
:
# 当选择的是父产业的园区时
induzone
=
Induzone
.
query
.
filter
(
Induzone
.
cate
.
like
(
'产业园区'
),
Induzone
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)))
induzone
=
Induzone
.
query
.
filter
(
Induzone
.
cate
.
like
(
'产业园区'
),
Induzone
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
name
)))
elif
select_flag
==
2
and
industry_level
==
2
:
# 当选择的是
父
产业的园区时
elif
select_flag
==
2
and
industry_level
==
2
:
# 当选择的是
子
产业的园区时
induzone
=
Induzone
.
query
.
filter
(
Induzone
.
cate
.
like
(
'产业园区'
),
Induzone
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)))
induzone
=
Induzone
.
query
.
filter
(
Induzone
.
cate
.
like
(
'产业园区'
),
Induzone
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
name
)))
size
=
induzone
.
count
()
# 分页总数
size
=
induzone
.
count
()
# 分页总数
...
...
apps/view_index/view.py
View file @
9b13a578
...
@@ -296,7 +296,6 @@ def attract_video():
...
@@ -296,7 +296,6 @@ def attract_video():
if
not
district
:
if
not
district
:
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不全"
)
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不全"
)
# district_dict = {'晋城市': '晋城市',
# district_dict = {'晋城市': '晋城市',
# '沁水市': '沁水市',
# '沁水市': '沁水市',
# '高平市': '高平市',
# '高平市': '高平市',
...
@@ -310,9 +309,12 @@ def attract_video():
...
@@ -310,9 +309,12 @@ def attract_video():
except
Exception
as
e
:
except
Exception
as
e
:
current_app
.
logger
.
error
(
e
)
current_app
.
logger
.
error
(
e
)
if
video
:
if
video
:
url
=
video
.
video_id1
video_url
=
video
.
video_id1
if
url
:
image_url
=
(
video
.
image_url
)
.
strip
()
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"查询成功"
,
data
=
{
"url"
:
url
})
print
(
video_url
)
print
(
image_url
)
if
video_url
:
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"查询成功"
,
data
=
{
"video_url"
:
video_url
,
"image_url"
:
image_url
})
else
:
else
:
return
jsonify
(
code
=
RET
.
DATAERR
,
msg
=
"区县名称有误,没有相关视频"
)
return
jsonify
(
code
=
RET
.
DATAERR
,
msg
=
"区县名称有误,没有相关视频"
)
...
...
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