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
dd00f400
Commit
dd00f400
authored
Sep 04, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商圈列表优化
parent
abb4e987
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
8 deletions
+30
-8
BusinessDistrict.php
application/index/controller/BusinessDistrict.php
+30
-8
No files found.
application/index/controller/BusinessDistrict.php
View file @
dd00f400
...
...
@@ -86,7 +86,7 @@ class BusinessDistrict extends Basic
/**
* 获取商圈列表
*
* @return
mixed
* @return
\think\Response|\think\response\View
*/
public
function
getBusiness
()
{
...
...
@@ -94,18 +94,40 @@ class BusinessDistrict extends Basic
$data
[
'status'
]
=
200
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$auth_group
=
New
GBusinessDistrict
();
$where
=
'is_del = 0'
;
if
(
$params
[
'name'
]
!=
NULL
)
{
$where
.=
' and name like "'
.
$params
[
'name'
]
.
'%"'
;
$where
[
'is_del'
]
=
0
;
if
(
$this
->
params
[
'name'
]
!=
NULL
)
{
$where
[
'name'
]
=
[
'LIKE'
,
'%'
.
$this
->
params
[
'name'
]
.
'%'
];
}
if
(
!
empty
(
$this
->
params
[
'province'
]))
{
$where
[
'province'
]
=
$this
->
params
[
'province'
];
}
if
(
!
empty
(
$this
->
params
[
'city'
]))
{
$where
[
'city'
]
=
$this
->
params
[
'city'
];
}
if
(
!
empty
(
$this
->
params
[
'disc'
]))
{
$where
[
'disc'
]
=
$this
->
params
[
'disc'
];
}
$fields
=
'id,name,province,city,disc,status,create_time'
;
$data
[
'list'
]
=
$auth_group
->
getList
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields
,
$where
);
$data
[
'total'
]
=
$auth_group
->
getTotal
(
$where
);
try
{
$auth_group
=
New
GBusinessDistrict
();
$data
[
'list'
]
=
$auth_group
->
getList
(
$pageNo
,
$pageSize
,
'id desc'
,
$fields
,
$where
);
$data
[
'total'
]
=
$auth_group
->
getTotal
(
$where
);
}
catch
(
\Exception
$e
)
{
$data
[
'list'
]
=
[];
$data
[
'total'
]
=
0
;
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
$e
->
getMessage
();
}
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
return
view
(
'business_district/index'
);
...
...
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