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
bb1a46b1
Commit
bb1a46b1
authored
Nov 02, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
ed6fac8d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
apps/models.py
+1
-0
apps/view_atlas/view.py
+7
-7
No files found.
apps/models.py
View file @
bb1a46b1
...
...
@@ -33,6 +33,7 @@ class IndustryChain(db.Model):
__table_args__
=
({
'comment'
:
'新版产业链数据数据表'
})
# 添加表注释
id
=
db
.
Column
(
db
.
Integer
,
primary_key
=
True
,
autoincrement
=
True
,
comment
=
'主键id'
)
industry_name
=
db
.
Column
(
db
.
String
(
20
),
comment
=
'行业名称'
)
oname
=
db
.
Column
(
db
.
String
(
20
),
comment
=
'行业名称,关联产业链图'
)
icon_url
=
db
.
Column
(
db
.
String
(
255
),
comment
=
'未选中时行业图标'
)
icon_url1
=
db
.
Column
(
db
.
String
(
255
),
comment
=
'选中时行业图标'
)
status
=
db
.
Column
(
db
.
Integer
,
doc
=
'启用状态1启用,2禁用'
,
comment
=
'启用状态1启用,2禁用'
)
# 启用状态1启用,2禁用
...
...
apps/view_atlas/view.py
View file @
bb1a46b1
...
...
@@ -77,14 +77,14 @@ def find_up_thr(name_query, relation):
# @login_required
def
get_cluster
():
try
:
# cluster_obj = IndustryChain.query.filter_by(industry_type=0, status=1).all()
# data = [{"id": i.id, 'name': i.industry_name, 'industry_level': 1,
# "icon": i.icon_url, "icon1": i.icon_url1}
# for i in cluster_obj]
cluster_obj
=
Industry
.
query
.
all
()
data
=
[{
"id"
:
i
.
id
,
'name'
:
i
.
oname
,
'oname'
:
i
.
name
,
'industry_level'
:
1
,
"icon"
:
''
,
"icon1"
:
''
}
cluster_obj
=
IndustryChain
.
query
.
all
()
data
=
[{
"id"
:
i
.
id
,
'name'
:
i
.
oname
,
'oname'
:
i
.
industry_name
,
'industry_level'
:
1
,
"icon"
:
i
.
icon_url
,
"icon1"
:
i
.
icon_url1
}
for
i
in
cluster_obj
]
# cluster_obj = Industry.query.all()
# data = [{"id": i.id, 'name': i.oname, 'oname': i.name, 'industry_level': 1,
# "icon": '', "icon1": ''}
# for i in cluster_obj]
return
jsonify
(
code
=
RET
.
OK
,
msg
=
'产业集群名称获取成功!'
,
data
=
data
)
except
Exception
as
e
:
...
...
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