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
7c95becf
Commit
7c95becf
authored
Mar 19, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取江浙沪城市和区
parent
d5a80fd7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Regions.php
application/model/Regions.php
+9
-3
No files found.
application/model/Regions.php
View file @
7c95becf
...
...
@@ -65,14 +65,20 @@ class Regions extends Model
}
/**
* 获取江浙沪城市
* 获取江浙沪城市
和区
*
* @return
false|\PDOStatement|string|\think\Collection
* @return
array
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRegionsCity
()
{
return
$this
->
field
(
'fullName'
)
->
where
(
'parentCode in (310000, 320000, 330000)'
)
->
select
();
$data
=
[];
$city_data
=
$this
->
field
(
'code,fullName'
)
->
where
(
'parentCode in (310000, 320000, 330000)'
)
->
select
();
foreach
(
$city_data
as
$k
=>
$v
)
{
$data
[
$k
][
'name'
]
=
$v
[
'fullName'
];
$data
[
$k
][
'city'
]
=
$this
->
where
(
'parentCode'
,
$v
[
'code'
])
->
column
(
'fullName'
);
}
return
$data
;
}
}
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