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
92c64f4e
Commit
92c64f4e
authored
Jul 17, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
办公室列表
parent
6d58992b
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
11 deletions
+37
-11
StoreFee.php
application/index/controller/StoreFee.php
+19
-8
AStore.php
application/model/AStore.php
+15
-0
FOffice.php
application/model/FOffice.php
+1
-2
route.php
application/route.php
+2
-1
No files found.
application/index/controller/StoreFee.php
View file @
92c64f4e
...
...
@@ -9,6 +9,7 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\model\AStore
;
use
app\model\FOffice
;
use
think\Request
;
...
...
@@ -65,23 +66,33 @@ class StoreFee extends Basic
* 办公室列表
* @return \think\Response
*/
public
function
get
Sit
eList
()
public
function
get
Offic
eList
()
{
$params
=
$this
->
params
;
/*$params = array(
"id" => 5740
"office_name" => '鳖'
"office_address" => '上海市黄浦区龙华东路800号'
);*/
$
field
=
'id,name,city,is_del'
;
$
conditions
=
[]
;
if
(
$params
[
'is_del'
])
{
$params
[
'is_del'
]
=
0
;
if
(
!
empty
(
$params
[
'office_name'
]))
{
$conditions
[
'office_name'
]
=
[
'LIKE'
,
'%'
.
$params
[
'office_name'
]
.
'%'
];
}
if
(
!
empty
(
$params
[
'office_address'
]))
{
$conditions
[
'office_address'
]
=
[
'LIKE'
,
'%'
.
$params
[
'office_address'
]
.
'%'
];
}
$field
=
'id,office_name,office_address,create_time'
;
$res
=
$this
->
f_office
->
getOffice
(
$field
,
$conditions
);
if
(
!
$res
)
return
$this
->
response
(
"200"
,
"成功"
,
[]);
$m_store
=
new
AStore
();
foreach
(
$res
as
$k
=>
$v
)
{
$res
[
$k
][
'store_num'
]
=
$m_store
->
getOfficeStore
(
$v
[
'id'
]);
//办公室门店数
}
$res
=
$this
->
f_office
->
getOffice
(
$field
,
$params
);
$data
[
'list'
]
=
$res
;
return
$this
->
response
(
"200"
,
"成功"
,
$data
);
}
...
...
application/model/AStore.php
View file @
92c64f4e
...
...
@@ -323,4 +323,18 @@ class AStore extends BaseModel
return
$data
;
}
/**
* 办公室门店数
* @param $office_id
* @return int|string
*/
public
function
getOfficeStore
(
$office_id
)
{
$params
[
'office_id'
]
=
$office_id
;
$params
[
'status'
]
=
0
;
$store_num
=
$this
->
where
(
$params
)
->
count
();
return
$store_num
;
}
}
\ No newline at end of file
application/model/FOffice.php
View file @
92c64f4e
...
...
@@ -54,12 +54,11 @@ class FOffice extends BaseModel
*/
public
function
getOffice
(
$field
,
$params
)
{
$params
[
'is_del'
]
=
0
;
$result
=
$this
->
db_
->
field
(
$field
)
//->alias('a')
->
where
(
$params
)
->
select
();
//dump($this->db_->getLastSql());
return
$result
;
}
//
...
...
application/route.php
View file @
92c64f4e
...
...
@@ -509,7 +509,8 @@ Route::group('index', [
'yindaoAndroidOffice'
=>
[
'index/ShareOfficeRoom/yindaoAndroid'
,
[
'method'
=>
'POST|GET'
]],
'yindaoIosOffice'
=>
[
'index/ShareOfficeRoom/yindaoIos'
,
[
'method'
=>
'POST|GET'
]],
'addOffice'
=>
[
'index/StoreFee/addOffice'
,
[
'method'
=>
'POST|GET'
]],
'addOffice'
=>
[
'index/StoreFee/addOffice'
,
[
'method'
=>
'POST|GET'
]
],
'getOfficeList'
=>
[
'index/StoreFee/getOfficeList'
,
[
'method'
=>
'POST|GET'
]
],
]);
...
...
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