Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
e65ce33c
Commit
e65ce33c
authored
Jun 11, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘删选
parent
2d599ab7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
18 deletions
+30
-18
Shop.php
application/api/controller/Shop.php
+13
-18
Regions.php
application/model/Regions.php
+17
-0
No files found.
application/api/controller/Shop.php
View file @
e65ce33c
...
...
@@ -15,6 +15,7 @@ use app\model\GLabels;
use
app\model\HouseImgs
;
use
app\model\HouseInfos
;
use
app\model\Labels
;
use
app\model\Regions
;
class
Shop
extends
Basic
{
...
...
@@ -211,32 +212,26 @@ class Shop extends Basic
*/
public
function
filtrateCondition
()
{
$field
=
"city,disc"
;
$param
[
'id'
]
=
array
(
'<>'
,
16
);
$param
[
'room_num_left'
]
=
array
(
'<>'
,
0
);
$group_
=
"disc"
;
$cityList
=
$this
->
db
->
getCityList
(
$field
,
$param
,
$group_
);
foreach
(
$cityList
as
$k
=>
$v
)
{
if
(
!
empty
(
$v
[
"city"
]))
{
$cityArr
[]
=
$v
[
"city"
];
}
}
$cityArr
=
array_unique
(
$cityArr
);
$regions
=
new
Regions
();
$cityList
=
$regions
->
getRegionsCitySH
();
$i
=
0
;
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
foreach
(
$cityArr
as
$key
=>
$val
)
{
$i
++
;
$result
[
"area"
][
$i
][
"city"
]
=
$val
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全"
.
$val
;
foreach
(
$cityList
as
$k
=>
$v
)
{
if
(
$val
==
$v
[
"city"
])
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$v
[
"disc"
];
$i
++
;
if
(
!
empty
(
$v
[
"name"
]))
{
$result
[
"area"
][
$i
][
"city"
]
=
$v
[
"name"
];
$result
[
"area"
][
$i
][
"disc"
][]
=
"全"
.
$v
[
"name"
];
}
foreach
(
$v
[
"city"
]
as
$item
)
{
if
(
!
empty
(
$item
))
{
$result
[
"area"
][
$i
][
"disc"
][]
=
$item
;
}
}
}
$result
[
'yetai'
]
=
array
(
'全部'
,
'餐饮美食'
,
'百货零售'
,
'休闲娱乐'
,
'其他'
);
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
...
...
application/model/Regions.php
View file @
e65ce33c
...
...
@@ -83,6 +83,23 @@ class Regions extends Model
return
$data
;
}
/**
* 获取沪城市和区
*
* @return array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRegionsCitySH
()
{
$data
=
[];
$city_data
=
$this
->
field
(
'code,fullName'
)
->
where
(
'parentCode in ( 310000)'
)
->
select
();
foreach
(
$city_data
as
$k
=>
$v
)
{
$data
[
$k
][
'name'
]
=
$v
[
'fullName'
];
$data
[
$k
][
'city'
]
=
$this
->
where
(
'parentCode'
,
$v
[
'code'
])
->
column
(
'fullName'
);
}
return
$data
;
}
/**
* 根据区code获取省市区中文
*
...
...
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