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
d7013478
Commit
d7013478
authored
Oct 07, 2023
by
ma_dev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
产业招商雷达bug处理
parent
7c8a5980
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
3 deletions
+31
-3
apps/view_radar/view.py
+31
-3
No files found.
apps/view_radar/view.py
View file @
d7013478
...
...
@@ -1216,7 +1216,7 @@ def radar_enums():
if
district
:
enterprise
=
enterprise
.
filter_by
(
district
=
district
)
company
=
[]
size
=
[]
if
product
:
# 有可能会变成模糊查询
# enterprise = enterprise.filter(or_(
...
...
@@ -1224,6 +1224,7 @@ def radar_enums():
# Enterprise.product_all1.like("%{}%".format(product)),
# Enterprise.product_all2.like("%{}%".format(product))
# ))
company
=
[]
indu_obj_li
=
get_product_li
(
product
,
inid
)
for
indu_name
in
indu_obj_li
:
...
...
@@ -1248,10 +1249,19 @@ def radar_enums():
company
+=
company3
# print("产品【{}】已完成, 共有{}家相关企业。".format(indu_name, len(company1 + company2 + company3)))
company
=
len
(
set
(
company
))
company
=
list
(
set
(
company
))
size
=
len
(
company
)
nums_all
=
company
if
company
else
enterprise
.
count
()
# 企业总数
nums_all
=
size
if
size
else
enterprise
.
count
()
# 企业总数
if
product
:
nums_dengl
=
len
([
tmp
.
id
for
tmp
in
company
if
tmp
.
dengl
==
"1"
])
# 瞪羚企业
nums_hignew
=
len
([
tmp
.
id
for
tmp
in
company
if
tmp
.
high_new
==
"1"
])
# 高新技术企业
nums_tbe
=
len
([
tmp
.
id
for
tmp
in
company
if
tmp
.
tbe
==
"1"
])
# 科技型中小企业
nums_quoted
=
len
([
tmp
.
id
for
tmp
in
company
if
tmp
.
quoted_company
==
"1"
])
# 上市企业
nums_financ
=
len
([
tmp
.
id
for
tmp
in
company
if
tmp
.
fianacing
==
"1"
])
# 有融资小企业
nums_unicorn
=
len
([
tmp
.
id
for
tmp
in
company
if
tmp
.
unicorn
==
"1"
])
# 独角兽企业
else
:
nums_dengl
=
enterprise
.
filter
(
Enterprise
.
dengl
==
"1"
)
.
count
()
# 瞪羚企业
nums_hignew
=
enterprise
.
filter
(
Enterprise
.
high_new
==
"1"
)
.
count
()
# 高新技术企业
nums_tbe
=
enterprise
.
filter
(
Enterprise
.
tbe
==
"1"
)
.
count
()
# 科技型中小企业
...
...
@@ -1524,6 +1534,24 @@ def newList1():
size
=
enterprise
.
count
()
enters
=
enterprise
.
order_by
(
Enterprise
.
hots
.
desc
())
.
paginate
(
page
,
perpage
)
.
items
if
product
:
if
select
==
"1"
:
# 瞪羚
remind
=
"瞪羚企业"
company
=
[
tmp
for
tmp
in
company
if
tmp
.
dengl
==
"1"
]
elif
select
==
"2"
:
# 高新
remind
=
"高新技术企业"
company
=
[
tmp
for
tmp
in
company
if
tmp
.
high_new
==
"1"
]
elif
select
==
"3"
:
# 科技型中小企业
remind
=
"科技型中小企业"
company
=
[
tmp
for
tmp
in
company
if
tmp
.
tbe
==
"1"
]
elif
select
==
"4"
:
# 上市
remind
=
"上市企业"
company
=
[
tmp
for
tmp
in
company
if
tmp
.
quoted_company
==
"1"
]
elif
select
==
"5"
:
# 融资
remind
=
"融资企业"
company
=
[
tmp
for
tmp
in
company
if
tmp
.
fianacing
==
"1"
]
elif
select
==
"6"
:
# 独角兽
remind
=
"独角兽企业"
company
=
[
tmp
for
tmp
in
company
if
tmp
.
unicorn
==
"1"
]
size
=
len
(
company
)
company1
=
sorted
(
company
,
key
=
lambda
x
:
x
.
hots
,
reverse
=
True
)
# 排序
enterprise_obj_list
=
company1
[(
page
-
1
)
*
perpage
:
page
*
perpage
]
# 分页
...
...
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