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
ba979cdb
Commit
ba979cdb
authored
Aug 09, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
e5c440d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Shop.php
application/api/controller/Shop.php
+3
-1
Regions.php
application/model/Regions.php
+2
-2
No files found.
application/api/controller/Shop.php
View file @
ba979cdb
...
@@ -213,9 +213,11 @@ class Shop extends Basic
...
@@ -213,9 +213,11 @@ class Shop extends Basic
*/
*/
public
function
filtrateCondition
()
public
function
filtrateCondition
()
{
{
$params
=
$this
->
params
;
$city_code
=
isset
(
$params
[
"city"
])
?
$params
[
"city"
]
:
"31000"
;
//上海31000 浙江 33000
$regions
=
new
Regions
();
$regions
=
new
Regions
();
$cityList
=
$regions
->
getRegionsCitySH
();
$cityList
=
$regions
->
getRegionsCitySH
(
$city_code
);
$i
=
0
;
$i
=
0
;
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
$result
[
"area"
][
$i
][
"city"
]
=
"全部"
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
$result
[
"area"
][
$i
][
"disc"
][]
=
"全部"
;
...
...
application/model/Regions.php
View file @
ba979cdb
...
@@ -91,9 +91,9 @@ class Regions extends Model
...
@@ -91,9 +91,9 @@ class Regions extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
getRegionsCitySH
()
{
public
function
getRegionsCitySH
(
$code
)
{
$data
=
[];
$data
=
[];
$city_data
=
$this
->
field
(
'code,fullName'
)
->
where
(
'parentCode in (
310000
)'
)
->
select
();
$city_data
=
$this
->
field
(
'code,fullName'
)
->
where
(
'parentCode in (
'
.
$code
.
'
)'
)
->
select
();
foreach
(
$city_data
as
$k
=>
$v
)
{
foreach
(
$city_data
as
$k
=>
$v
)
{
$data
[
$k
][
'name'
]
=
$v
[
'fullName'
];
$data
[
$k
][
'name'
]
=
$v
[
'fullName'
];
$data
[
$k
][
'city'
]
=
$this
->
where
(
'parentCode'
,
$v
[
'code'
])
->
column
(
'fullName'
);
$data
[
$k
][
'city'
]
=
$this
->
where
(
'parentCode'
,
$v
[
'code'
])
->
column
(
'fullName'
);
...
...
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