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
5ac19b1e
Commit
5ac19b1e
authored
Jan 11, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230111
parent
dc6aa2e1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
apps/view_atlas/view.py
+12
-5
apps/view_choose/view.py
+4
-3
No files found.
apps/view_atlas/view.py
View file @
5ac19b1e
...
...
@@ -292,7 +292,8 @@ def industry_chain():
# return jsonify(code=RET.OK, msg="获取成功", data=data)
# 行业使用名
industryName
=
Industry
.
query
.
filter_by
(
nid
=
inid
)
.
first
()
.
oname
# industryName = Industry.query.filter_by(nid=inid).first().oname
industryName
=
IndustryChain
.
query
.
filter_by
(
id
=
inid
)
.
first
()
.
industry_name
ptp
=
neo4j_dict
()
if
industryName
in
ptp
:
industryName
=
ptp
[
industryName
]
...
...
@@ -330,7 +331,8 @@ def industry_resource():
if
not
all
([
inid
,
industry_level
,
select_flag
,
page
,
perpage
]):
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
name
=
Industry
.
query
.
filter_by
(
nid
=
inid
)
.
first
()
.
oname
# name = Industry.query.filter_by(nid=inid).first().oname
name
=
IndustryChain
.
query
.
filter_by
(
id
=
inid
)
.
first
()
.
industry_name
if
select_flag
==
1
:
# 高等院校
try
:
...
...
@@ -526,7 +528,9 @@ def industry_zaiti():
return
jsonify
(
code
=
RET
.
PARAMERR
,
msg
=
"参数不完整"
)
# if inid:
name
=
Industry
.
query
.
filter_by
(
nid
=
inid
)
.
first
()
.
oname
# 获取导航对应的真名
# name = Industry.query.filter_by(nid=inid).first().oname # 获取导航对应的真名
name
=
IndustryChain
.
query
.
filter_by
(
id
=
inid
)
.
first
()
.
industry_name
try
:
data
=
get_data
(
name
,
industry_level
,
select_flag
,
page
,
perpage
)
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"数据查询成功"
,
data
=
data
)
...
...
@@ -1073,13 +1077,16 @@ def industry_collect():
try
:
if
collect
==
"2"
:
# 未关注,我要关注
user
=
User
.
query
.
get
(
user_id
)
indu
=
Industry
.
query
.
filter_by
(
nid
=
_id
)
.
first
()
# indu = Industry.query.filter_by(nid=_id).first()
indu
=
IndustryChain
.
query
.
filter_by
(
id
=
_id
)
.
first
()
user
.
industry
.
append
(
indu
)
db
.
session
.
commit
()
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"收藏成功"
,
collect
=
"1"
)
elif
collect
==
"1"
:
# 已关注,我要取关
user
=
User
.
query
.
get
(
user_id
)
indu
=
Industry
.
query
.
filter_by
(
nid
=
_id
)
.
first
()
# indu = Industry.query.filter_by(nid=_id).first()
indu
=
IndustryChain
.
query
.
filter_by
(
id
=
_id
)
.
first
()
user
.
industry
.
remove
(
indu
)
db
.
session
.
commit
()
return
jsonify
(
code
=
RET
.
OK
,
msg
=
"取消成功"
,
collect
=
"2"
)
...
...
apps/view_choose/view.py
View file @
5ac19b1e
from
sqlalchemy
import
func
,
desc
,
or_
,
text
,
and_
from
flask
import
current_app
,
request
,
jsonify
from
apps.models
import
Induzone
,
Industry
,
CompanyIndustryPoint
,
User
from
apps.models
import
*
from
apps.utils.response_code
import
RET
from
apps.view_choose
import
api_address
...
...
@@ -99,7 +99,8 @@ def advice():
Induzone
.
tax
<
tax
if
tax
else
text
(
''
)
)
if
industry_id
:
indu
=
Industry
.
query
.
filter_by
(
nid
=
industry_id
)
.
first
()
# indu = Industry.query.filter_by(nid=industry_id).first()
indu
=
IndustryChain
.
query
.
filter_by
(
id
=
industry_id
)
.
first
()
if
not
indu
:
return
jsonify
(
code
=
RET
.
DATAERR
,
msg
=
"参数错误"
)
# 获取产业名称
...
...
@@ -145,7 +146,7 @@ def advice():
@api_address.route
(
"/DownList"
,
methods
=
[
"GET"
])
def
downlist
():
# 一级二级行业分类
try
:
industry
=
Industry
.
query
.
filter_by
(
statu
=
1
)
.
all
()
industry
=
Industry
Chain
.
query
.
filter_by
(
statu
=
1
)
.
all
()
data
=
[{
"name"
:
i
.
name
,
"id"
:
i
.
nid
,
...
...
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