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
c5edd9f3
Commit
c5edd9f3
authored
Jun 04, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
报备搜索办公楼
parent
3547b3d4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
0 deletions
+80
-0
OfficeRoom.php
application/api_broker/controller/OfficeRoom.php
+46
-0
OfficeGRoom.php
application/model/OfficeGRoom.php
+33
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/OfficeRoom.php
View file @
c5edd9f3
...
@@ -13,6 +13,7 @@ use app\api_broker\extend\Basic;
...
@@ -13,6 +13,7 @@ use app\api_broker\extend\Basic;
use
app\index\service\OfficeRoomService
;
use
app\index\service\OfficeRoomService
;
use
app\index\service\OfficeService
;
use
app\index\service\OfficeService
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGRoom
;
class
OfficeRoom
extends
Basic
class
OfficeRoom
extends
Basic
{
{
...
@@ -160,4 +161,48 @@ class OfficeRoom extends Basic
...
@@ -160,4 +161,48 @@ class OfficeRoom extends Basic
return
$this
->
result
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
return
$this
->
result
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
/**
* 报备搜索商铺
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getRoomListByReport
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
array
(
"keyword"
=>
"1"
,
//1,2 external_title ,3,4internal_title
"pageNo"
=>
1
,
"pageSize"
=>
15
);
$conditions
=
[];
$field
=
"a.id,b.title,b.address"
;
if
(
empty
(
$params
[
"city"
])){
$conditions
[
"b.city"
]
=
trim
(
$this
->
city
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
if
(
isset
(
$params
[
'keyword'
])
&&
!
empty
(
$params
[
'keyword'
])
)
{
$conditions
[
'a.id|b.title'
]
=
array
(
"like"
,
"%"
.
trim
(
$params
[
'keyword'
])
.
"%"
);
}
$order_
=
"b.status asc,b.id desc"
;
$conditions
[
'b.status'
]
=
array
(
'eq'
,
1
);
//只显示上架
$m_office_build
=
new
OfficeGRoom
();
$result
=
$m_office_build
->
getRoomList
(
$pageNo
,
$pageSize
,
$order_
,
$field
,
$conditions
,
[]);
if
(
empty
(
$result
))
{
return
$this
->
response
(
"200"
,
"此条件没有找到数据"
);
}
return
$this
->
response
(
"200"
,
'request success'
,
$result
);
}
}
}
\ No newline at end of file
application/model/OfficeGRoom.php
View file @
c5edd9f3
...
@@ -335,4 +335,37 @@ class OfficeGRoom extends BaseModel
...
@@ -335,4 +335,37 @@ class OfficeGRoom extends BaseModel
->
select
();
->
select
();
return
$result
;
return
$result
;
}
}
/**
* 查询商铺列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param $spTagsArr
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
function
getRoomList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$spTagsArr
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'office_g_building b'
,
'a.building_id = b.id'
,
'left'
)
->
where
(
$params
)
->
where
(
function
(
$query
)
use
(
$spTagsArr
)
{
$query
->
whereOr
(
$spTagsArr
);
})
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
//echo Db::table($this->table)->getLastSql();
return
$result
;
}
}
}
application/route.php
View file @
c5edd9f3
...
@@ -982,6 +982,7 @@ Route::group('office', [
...
@@ -982,6 +982,7 @@ Route::group('office', [
'reportList'
=>
[
'api_broker/OfficeReport/reportList'
,
[
'method'
=>
'get'
]],
'reportList'
=>
[
'api_broker/OfficeReport/reportList'
,
[
'method'
=>
'get'
]],
'getCheckType'
=>
[
'api_broker/OfficeReport/getCheckType'
,
[
'method'
=>
'get|post'
]],
'getCheckType'
=>
[
'api_broker/OfficeReport/getCheckType'
,
[
'method'
=>
'get|post'
]],
'reportListForPc'
=>
[
'api_broker/OfficeReport/reportListForPc'
,
[
'method'
=>
'get'
]],
'reportListForPc'
=>
[
'api_broker/OfficeReport/reportListForPc'
,
[
'method'
=>
'get'
]],
'getRoomListByReport'
=>
[
'api_broker/OfficeRoom/getRoomListByReport'
,
[
'method'
=>
'get|post'
]],
]);
]);
Route
::
group
(
'office_index'
,
[
Route
::
group
(
'office_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