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
e5e9cf04
Commit
e5e9cf04
authored
Feb 17, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix202302017
parent
9a133484
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
4 deletions
+37
-4
apps/view_360company/view.py
+37
-4
No files found.
apps/view_360company/view.py
View file @
e5e9cf04
...
...
@@ -29,12 +29,18 @@ def get_all_enterprise():
enterprise_all_counts
=
Enterprise
.
query
.
count
()
enterprise_list
=
Enterprise
.
query
.
paginate
(
page
,
perpage
)
.
items
if
enterprise_list
:
data
=
{
"data"
:
[{
"id"
:
enterprise
.
id
,
data_list
=
[]
for
enterprise
in
enterprise_list
:
province
=
enterprise
.
province
if
enterprise
.
province
else
''
city
=
enterprise
.
city
if
enterprise
.
city
else
''
district
=
enterprise
.
district
if
enterprise
.
district
else
''
area
=
province
+
city
+
district
data
=
{
"id"
:
enterprise
.
id
,
"company"
:
enterprise
.
company_name
,
# 企业名
"area"
:
''
,
"area"
:
area
,
"createtime"
:
(
enterprise
.
build_date
)
.
strftime
(
"
%
Y-
%
m-
%
d"
)
if
enterprise
.
build_date
else
''
,
"legal"
:
enterprise
.
legal
,
"capital"
:
enterprise
.
capital
,
"entype"
:
enterprise
.
entype
,
...
...
@@ -53,7 +59,34 @@ def get_all_enterprise():
"zjtg_gjjxjr"
:
'国家级专精特新小巨人企业'
if
enterprise
.
zjtg_gjjxjr
==
'1'
else
""
,
"zjtg_sjxjr"
:
'省级专精特新小巨人企业'
if
enterprise
.
zjtg_sjxjr
==
'1'
else
""
,
"tbe_sjmy"
:
'省级民营科技企业'
if
enterprise
.
tbe_sjmy
==
'1'
else
""
,
}
for
enterprise
in
enterprise_list
],
"size"
:
enterprise_all_counts
}
}
data_list
.
append
(
data
)
data
=
{
"data"
:
data_list
}
# data = {"data": [{"id": enterprise.id,
# "company": enterprise.company_name, # 企业名
# "area": enterprise.province if enterprise.province else '' + enterprise.city if enterprise.city else '' + enterprise.district if enterprise.district else '',
# "createtime": (enterprise.build_date).strftime("%Y-%m-%d") if enterprise.build_date else '',
#
#
# "legal": enterprise.legal,
# "capital": enterprise.capital,
# "entype": enterprise.entype,
# "address": enterprise.address,
# "telephone": enterprise.telephone,
# "fianacing": '融资企业' if enterprise.fianacing == "1" else '',
# "quoted_company": '上市企业' if enterprise.quoted_company == "1" else '',
#
# "high_new": '高新技术企业' if enterprise.high_new == '1' else "",
# "tbe": '科技型中小企业' if enterprise.tbe == '1' else "",
# "quoted_enterprise": '上市企业' if enterprise.quoted_company == '1' else "",
# "unicorn": '独角兽企业' if enterprise.unicorn == '1' else "",
# "dengl": '瞪羚' if enterprise.dengl == '1' else "",
# "isfive": '中国500强' if enterprise.isfive == '1' else "",
# "zjtg": '专精特新企业' if enterprise.zjtg == '1' else "",
# "zjtg_gjjxjr": '国家级专精特新小巨人企业' if enterprise.zjtg_gjjxjr == '1' else "",
# "zjtg_sjxjr": '省级专精特新小巨人企业' if enterprise.zjtg_sjxjr == '1' else "",
# "tbe_sjmy": '省级民营科技企业' if enterprise.tbe_sjmy == '1' else "",
# } for enterprise in enterprise_list], "size": enterprise_all_counts}
else
:
return
jsonify
(
code
=
RET
.
NODATA
,
msg
=
"查无数据"
)
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