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
600e4541
Commit
600e4541
authored
Feb 17, 2022
by
赵宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
471bb567
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
apps/models.py
+1
-0
apps/view_choose/view.py
+13
-13
No files found.
apps/models.py
View file @
600e4541
...
@@ -691,6 +691,7 @@ class Induzone(db.Model):
...
@@ -691,6 +691,7 @@ class Induzone(db.Model):
mall_point
=
db
.
Column
(
db
.
Float
,
doc
=
'购物中心的评分'
,
comment
=
'购物中心的评分'
)
# 购物中心的评分
mall_point
=
db
.
Column
(
db
.
Float
,
doc
=
'购物中心的评分'
,
comment
=
'购物中心的评分'
)
# 购物中心的评分
hotel_point
=
db
.
Column
(
db
.
Float
,
doc
=
'酒店餐饮的评分'
,
comment
=
'酒店餐饮的评分'
)
# 酒店餐饮的评分
hotel_point
=
db
.
Column
(
db
.
Float
,
doc
=
'酒店餐饮的评分'
,
comment
=
'酒店餐饮的评分'
)
# 酒店餐饮的评分
development_zone
=
db
.
Column
(
db
.
String
(
255
),
doc
=
'所在开发区'
,
comment
=
'所在开发区'
)
# 所在开发区
development_zone
=
db
.
Column
(
db
.
String
(
255
),
doc
=
'所在开发区'
,
comment
=
'所在开发区'
)
# 所在开发区
upper_district
=
db
.
Column
(
db
.
String
(
255
),
doc
=
'上级行政区'
,
comment
=
'上级行政区'
)
# 所在开发区
# 项目列表
# 项目列表
# class Item(db.Model):
# class Item(db.Model):
...
...
apps/view_choose/view.py
View file @
600e4541
...
@@ -14,14 +14,18 @@ def default_address():
...
@@ -14,14 +14,18 @@ def default_address():
perpage
=
req_dict
.
get
(
"perpage"
)
perpage
=
req_dict
.
get
(
"perpage"
)
# 查询出该区县的所有园区列表
# 查询出该区县的所有园区列表
try
:
try
:
result
=
Induzone
.
query
.
filter_by
(
district
=
district
)
.
all
()
if
district
==
"晋城市"
:
all_jwd
=
[{
"id"
:
i
.
id
,
"name"
:
i
.
name
,
"lng"
:
i
.
lng
,
"lat"
:
i
.
lat
}
for
i
in
result
]
result
=
Induzone
.
query
.
filter_by
(
upper_district
=
district
)
.
all
()
size
=
len
(
result
)
all_jwd
=
[{
"id"
:
i
.
id
,
"name"
:
i
.
name
,
"lng"
:
i
.
lng
,
"lat"
:
i
.
lat
}
for
i
in
result
]
result
=
Induzone
.
query
.
filter_by
(
district
=
district
)
size
=
len
(
result
)
result
=
result
.
paginate
(
page
,
perpage
)
.
items
result
=
Induzone
.
query
.
filter_by
(
upper_district
=
district
)
result
=
result
.
paginate
(
page
,
perpage
)
.
items
print
(
result
)
else
:
print
(
result
)
result
=
Induzone
.
query
.
filter_by
(
district
=
district
)
.
all
()
all_jwd
=
[{
"id"
:
i
.
id
,
"name"
:
i
.
name
,
"lng"
:
i
.
lng
,
"lat"
:
i
.
lat
}
for
i
in
result
]
size
=
len
(
result
)
result
=
Induzone
.
query
.
filter_by
(
district
=
district
)
result
=
result
.
paginate
(
page
,
perpage
)
.
items
if
not
result
:
if
not
result
:
# 在第一条建议显示
# 在第一条建议显示
data
=
[{
"name"
:
"没有找到合适的园区!"
}]
data
=
[{
"name"
:
"没有找到合适的园区!"
}]
...
@@ -71,7 +75,6 @@ def advice():
...
@@ -71,7 +75,6 @@ def advice():
# 根据产业名称查询园区
# 根据产业名称查询园区
zone
=
Induzone
.
query
.
filter
(
or_
(
Induzone
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
industry_name
)),
zone
=
Induzone
.
query
.
filter
(
or_
(
Induzone
.
navigat
.
like
(
"
%
{}
%
"
.
format
(
industry_name
)),
Induzone
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
industry_name
))))
Induzone
.
navigator
.
like
(
"
%
{}
%
"
.
format
(
industry_name
))))
print
(
type
(
zone
))
# 根据投资预算过滤
# 根据投资预算过滤
if
budget
:
if
budget
:
zone
=
zone
.
filter
(
Induzone
.
invest_power
<
budget
)
zone
=
zone
.
filter
(
Induzone
.
invest_power
<
budget
)
...
@@ -92,11 +95,8 @@ def advice():
...
@@ -92,11 +95,8 @@ def advice():
if
preference
[
4
]
==
"true"
:
# 交通 -----交通打分
if
preference
[
4
]
==
"true"
:
# 交通 -----交通打分
zone
=
zone
.
order_by
(
Induzone
.
traffic_point
.
desc
())
zone
=
zone
.
order_by
(
Induzone
.
traffic_point
.
desc
())
size
=
zone
.
count
()
size
=
zone
.
count
()
print
(
type
(
zone
))
result
=
zone
.
paginate
(
page
,
perpage
)
.
items
result
=
zone
.
paginate
(
page
,
perpage
)
.
items
print
(
type
(
zone
))
zone
=
zone
.
all
zone
=
zone
.
all
()
all_jwd
=
[{
"id"
:
i
.
id
,
"name"
:
i
.
name
,
"lng"
:
i
.
lng
,
"lat"
:
i
.
lat
}
for
i
in
zone
]
all_jwd
=
[{
"id"
:
i
.
id
,
"name"
:
i
.
name
,
"lng"
:
i
.
lng
,
"lat"
:
i
.
lat
}
for
i
in
zone
]
data
=
{
"data"
:
[{
"id"
:
i
.
id
,
data
=
{
"data"
:
[{
"id"
:
i
.
id
,
"name"
:
i
.
name
,
# 园区名称
"name"
:
i
.
name
,
# 园区名称
...
...
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