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
152e6d7d
Commit
152e6d7d
authored
Jun 03, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
楼盘房源列表
parent
5a1c9757
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
19 deletions
+52
-19
OfficeRoom.php
application/index/controller/OfficeRoom.php
+21
-2
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+19
-8
OfficeGRoom.php
application/model/OfficeGRoom.php
+8
-6
OfficeGRoomToAgent.php
application/model/OfficeGRoomToAgent.php
+2
-3
route.php
application/route.php
+2
-0
No files found.
application/index/controller/OfficeRoom.php
View file @
152e6d7d
...
@@ -115,10 +115,28 @@ class OfficeRoom extends Basic
...
@@ -115,10 +115,28 @@ class OfficeRoom extends Basic
return
$this
->
response
(
$code
,
$msg
,
$data
);
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
}
/**
* 楼盘房源列表
*
* @return \think\Response
*/
public
function
getRoomList
()
public
function
getRoomList
()
{
{
if
(
!
$this
->
request
->
isAjax
())
{
return
view
(
''
);
}
$code
=
200
;
$data
=
[];
$msg
=
''
;
$result
=
$this
->
service
->
getRoomList
(
$this
->
params
,
1
);
if
(
$result
[
'status'
]
==
'successful'
)
{
$data
[
'list'
]
=
$result
[
'data'
];
$data
[
'total'
]
=
$result
[
'total'
];
}
else
{
$code
=
101
;
$msg
=
$result
[
'msg'
];
}
return
$this
->
response
(
$code
,
$msg
,
$data
);
}
}
}
}
\ No newline at end of file
application/index/service/OfficeRoomService.php
View file @
152e6d7d
...
@@ -13,6 +13,7 @@ use app\api_broker\service\PushMessageService;
...
@@ -13,6 +13,7 @@ use app\api_broker\service\PushMessageService;
use
app\api_broker\service\RedisCacheService
;
use
app\api_broker\service\RedisCacheService
;
use
app\index\validate\OfficeBuildingRoomValidate
;
use
app\index\validate\OfficeBuildingRoomValidate
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\GBusinessDistrict
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGBuilding
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGImg
;
use
app\model\OfficeGLandlordPhone
;
use
app\model\OfficeGLandlordPhone
;
...
@@ -335,10 +336,6 @@ class OfficeRoomService
...
@@ -335,10 +336,6 @@ class OfficeRoomService
if
(
$data
[
'management_fee'
]
>
0
)
{
if
(
$data
[
'management_fee'
]
>
0
)
{
$data
[
'management_fee'
]
=
$data
[
'management_fee'
]
/
100
;
$data
[
'management_fee'
]
=
$data
[
'management_fee'
]
/
100
;
}
}
if
(
$data
[
'rent_free'
]
>
0
)
{
$data
[
'rent_free'
]
=
$data
[
'rent_free'
]
/
100
;
}
}
}
$result
[
'data'
]
=
$data
;
$result
[
'data'
]
=
$data
;
$result
[
'status'
]
=
'successful'
;
$result
[
'status'
]
=
'successful'
;
...
@@ -794,13 +791,27 @@ class OfficeRoomService
...
@@ -794,13 +791,27 @@ class OfficeRoomService
}
}
}
}
/*房东手机号搜索 end*/
/*房东手机号搜索 end*/
$field
=
'a.id'
;
$field
=
'a.id,b.type,b.disc,b.business_district_id,b.title,a.price_total,a.area,a.station_start,a.station_end,'
;
$field
.=
'a.status,a.is_rent,a.is_show,a.create_time'
;
$result
[
'data'
]
=
$this
->
m_office_room
->
getRoomAgent
(
$page_no
,
$page_size
,
$field
,
$where
);
$room_data
=
$this
->
m_office_room
->
getRoomAgent
(
$page_no
,
$page_size
,
$field
,
$where
);
$m_business
=
new
GBusinessDistrict
();
foreach
(
$room_data
as
$k
=>
$v
)
{
$room_data
[
$k
][
'business_name'
]
=
$m_business
->
getValue
([
'id'
=>
$v
[
'business_district_id'
]],
'name'
);
$room_data
[
$k
][
'price_total'
]
=
$room_data
[
$k
][
'price_total'
]
/
100
;
$dish_name
=
$this
->
agent_room
->
getAgentsByRoomColumn
(
'b.name'
,
[
'a.house_id'
=>
$v
[
'id'
]]);
if
(
empty
(
$dish_name
))
{
$room_data
[
$k
][
'dish_name'
]
=
''
;
}
else
{
$room_data
[
$k
][
'dish_name'
]
=
implode
(
$dish_name
,
','
);
}
}
if
(
$is_total
)
{
if
(
$is_total
)
{
$result
[
'total'
]
=
$this
->
m_office_room
->
getRoomAgentTotal
(
$where
);
$result
[
'total'
]
=
$this
->
m_office_room
->
getRoomAgentTotal
(
$where
);
}
}
$result
[
'data'
]
=
$room_data
;
$result
[
'status'
]
=
'successful'
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
$result
[
'msg'
]
=
$e
->
getMessage
();
$result
[
'msg'
]
=
$e
->
getMessage
();
}
}
...
...
application/model/OfficeGRoom.php
View file @
152e6d7d
...
@@ -275,12 +275,13 @@ class OfficeGRoom extends BaseModel
...
@@ -275,12 +275,13 @@ class OfficeGRoom extends BaseModel
{
{
return
$this
->
alias
(
'a'
)
return
$this
->
alias
(
'a'
)
->
field
(
$field
)
->
field
(
$field
)
->
join
(
'office_g_
room_to_agent b'
,
'a.id = b.house_
id'
,
'left'
)
->
join
(
'office_g_
building b'
,
'a.building_id = b.
id'
,
'left'
)
->
join
(
'
a_agents b'
,
'b.agent_id = b.
id'
,
'left'
)
->
join
(
'
office_g_room_to_agent c'
,
'a.id = c.house_
id'
,
'left'
)
->
join
(
'
office_g_building c'
,
'a.building_id = c
.id'
,
'left'
)
->
join
(
'
a_agents d'
,
'c.agent_id = d
.id'
,
'left'
)
->
where
(
$where
)
->
where
(
$where
)
->
limit
(
$page_size
)
->
limit
(
$page_size
)
->
page
(
$page_no
)
->
page
(
$page_no
)
->
group
(
'a.id'
)
->
select
();
->
select
();
}
}
...
@@ -299,10 +300,11 @@ class OfficeGRoom extends BaseModel
...
@@ -299,10 +300,11 @@ class OfficeGRoom extends BaseModel
public
function
getRoomAgentTotal
(
$where
)
public
function
getRoomAgentTotal
(
$where
)
{
{
return
$this
->
alias
(
'a'
)
return
$this
->
alias
(
'a'
)
->
join
(
'office_g_
room_to_agent b'
,
'a.id = b.house_
id'
,
'left'
)
->
join
(
'office_g_
building b'
,
'a.building_id = b.
id'
,
'left'
)
->
join
(
'
a_agents b'
,
'b.agent_id = b.
id'
,
'left'
)
->
join
(
'
office_g_room_to_agent c'
,
'a.id = c.house_
id'
,
'left'
)
->
join
(
'
office_g_building c'
,
'a.building_id = c
.id'
,
'left'
)
->
join
(
'
a_agents d'
,
'c.agent_id = d
.id'
,
'left'
)
->
where
(
$where
)
->
where
(
$where
)
->
group
(
'a.id'
)
->
count
(
'a.id'
);
->
count
(
'a.id'
);
}
}
...
...
application/model/OfficeGRoomToAgent.php
View file @
152e6d7d
...
@@ -147,10 +147,9 @@ class OfficeGRoomToAgent extends BaseModel
...
@@ -147,10 +147,9 @@ class OfficeGRoomToAgent extends BaseModel
public
function
getAgentsByRoomColumn
(
$field
,
$params
=
[])
public
function
getAgentsByRoomColumn
(
$field
,
$params
=
[])
{
{
$params
[
'a.is_del'
]
=
0
;
$params
[
'a.is_del'
]
=
0
;
return
$this
->
db_
->
field
(
$field
)
return
$this
->
db_
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agent_id = b.id"
,
"left"
)
->
join
(
"a_agents b"
,
"a.agent_id = b.id"
,
"left"
)
->
where
(
$params
)
->
where
(
$params
)
->
column
();
->
column
(
$field
);
}
}
}
}
application/route.php
View file @
152e6d7d
...
@@ -984,6 +984,7 @@ Route::group('office_index', [
...
@@ -984,6 +984,7 @@ Route::group('office_index', [
'getBuildingDetail'
=>
[
'index/OfficeRoom/getBuildingDetail'
,
[
'method'
=>
'GET'
]],
//楼盘详情
'getBuildingDetail'
=>
[
'index/OfficeRoom/getBuildingDetail'
,
[
'method'
=>
'GET'
]],
//楼盘详情
'getBuildingList'
=>
[
'index/OfficeManage/getBuildingList'
,
[
'method'
=>
'GET'
]],
//楼盘列表
'getBuildingList'
=>
[
'index/OfficeManage/getBuildingList'
,
[
'method'
=>
'GET'
]],
//楼盘列表
'delBuilding'
=>
[
'index/OfficeManage/delBuilding'
,
[
'method'
=>
'GET'
]],
//删除楼盘
'delBuilding'
=>
[
'index/OfficeManage/delBuilding'
,
[
'method'
=>
'GET'
]],
//删除楼盘
'getRoomList'
=>
[
'index/OfficeRoom/getRoomList'
,
[
'method'
=>
'GET'
]],
//删除楼盘
]);
]);
//Route::miss('api/index/miss');//处理错误的url
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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