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
dd9740c4
Commit
dd9740c4
authored
Apr 27, 2023
by
dong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix20230427
parent
f59689e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
7 deletions
+16
-7
apps/view_radar/view.py
+16
-7
No files found.
apps/view_radar/view.py
View file @
dd9740c4
...
@@ -294,7 +294,7 @@ def prolink():
...
@@ -294,7 +294,7 @@ def prolink():
edata
=
edata
.
all
()
edata
=
edata
.
all
()
if
edata
:
if
edata
:
num
=
[
math
.
ceil
(
i
.
score
)
if
i
.
score
else
0
for
i
in
edata
]
num
=
list
(
set
(
math
.
ceil
(
i
.
score
)
if
i
.
score
else
0
for
i
in
edata
))
num
.
sort
()
num
.
sort
()
num
=
[
i
for
i
in
num
if
i
>
0
]
num
=
[
i
for
i
in
num
if
i
>
0
]
if
not
num
:
if
not
num
:
...
@@ -325,12 +325,21 @@ def prolink():
...
@@ -325,12 +325,21 @@ def prolink():
# 按照企业数量排序
# 按照企业数量排序
for
name
in
result_bylink
:
for
name
in
result_bylink
:
company_count
=
Enterprise
.
query
.
filter
(
Enterprise
.
city
!=
'晋城市'
)
.
filter
(
or_
(
# company_count = Enterprise.query.filter(Enterprise.city != '晋城市').filter(or_(
Enterprise
.
product_all
.
like
(
"
%
{}
%
"
.
format
(
name
)),
# Enterprise.product_all.like("%{}%".format(name)),
Enterprise
.
product_all1
.
like
(
"
%
{}
%
"
.
format
(
name
)),
# Enterprise.product_all1.like("%{}%".format(name)),
Enterprise
.
product_all2
.
like
(
"
%
{}
%
"
.
format
(
name
))
# Enterprise.product_all2.like("%{}%".format(name))
))
.
count
()
# )).count()
df2
.
append
({
'name'
:
name
,
'company_count'
:
company_count
})
try
:
company_count
=
IndustryChain
.
query
.
filter_by
(
industry_name
=
name
,
chain_id
=
inid
)
.
first
()
.
enterprise_num
if
company_count
:
pass
else
:
company_count
=
0
df2
.
append
({
'name'
:
name
,
'company_count'
:
company_count
})
except
:
company_count
=
0
df2
.
append
({
'name'
:
name
,
'company_count'
:
company_count
})
df2
.
sort
(
key
=
lambda
s
:
s
[
'company_count'
],
reverse
=
True
)
df2
.
sort
(
key
=
lambda
s
:
s
[
'company_count'
],
reverse
=
True
)
df2
=
df2
[(
page
-
1
)
*
perpage
:
page
*
perpage
]
df2
=
df2
[(
page
-
1
)
*
perpage
:
page
*
perpage
]
data
=
{
"df"
:
df2
,
"size"
:
res
}
data
=
{
"df"
:
df2
,
"size"
:
res
}
...
...
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