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
27d9f962
Commit
27d9f962
authored
Feb 06, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通过部门id获得门店列表
parent
133badac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
2 deletions
+29
-2
Store.php
application/index/controller/Store.php
+28
-2
route.php
application/route.php
+1
-0
No files found.
application/index/controller/Store.php
View file @
27d9f962
...
...
@@ -32,7 +32,7 @@ class Store extends Basic
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$field
=
'a.id,a.district_id,a.store_name,a.create_time'
;
$where
[
'a.status'
]
=
0
;
$join
=
0
;
//门店名
if
(
!
empty
(
$this
->
params
[
'store_name'
]))
{
$where
[
'store_name'
]
=
[
'LIKE'
,
$this
->
params
[
'store_name'
]
.
'%'
];
...
...
@@ -95,8 +95,8 @@ class Store extends Basic
* @throws \think\exception\DbException
*/
public
function
getStoreById
()
{
$district
=
new
AStore
();
if
(
$this
->
params
[
'id'
])
{
$district
=
new
AStore
();
$this
->
data
=
$district
->
getStoreById
(
$this
->
params
[
'id'
]);
}
else
{
$this
->
code
=
101
;
...
...
@@ -105,4 +105,29 @@ class Store extends Basic
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
/**
* 通过部门id获取门店列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getStoreByDistrictId
()
{
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
if
(
$this
->
params
[
'id'
])
{
$store
=
new
AStore
();
$field
=
'id,district_id,store_name,create_time'
;
$where
[
'district_id'
]
=
$this
->
params
[
'id'
];
$where
[
'status'
]
=
0
;
$this
->
data
=
$store
->
getStoreList
(
$pageNo
,
$pageSize
,
'id DESC'
,
$field
,
$where
);
}
else
{
$this
->
code
=
101
;
$this
->
msg
=
'id is null'
;
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
\ No newline at end of file
application/route.php
View file @
27d9f962
...
...
@@ -131,6 +131,7 @@ Route::group('index', [
'storeList'
=>
[
'index/Store/index'
,[
'method'
=>
'get'
]],
//门店列表
'addStore'
=>
[
'index/Store/addStore'
,[
'method'
=>
'get|post'
]],
//添加门店
'getStoreById'
=>
[
'index/Store/getStoreById'
,[
'method'
=>
'get'
]],
//通过id获得门店信息
'getDistrictStoreList'
=>
[
'index/Store/getStoreByDistrictId'
,[
'method'
=>
'get'
]],
//通过部门id获得门店列表
]);
...
...
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