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
a3132feb
Commit
a3132feb
authored
Jun 03, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加字段
parent
56f1dfce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
38 deletions
+72
-38
OfficeRoomService.php
application/index/service/OfficeRoomService.php
+50
-38
OfficeGRoom.php
application/model/OfficeGRoom.php
+22
-0
No files found.
application/index/service/OfficeRoomService.php
View file @
a3132feb
...
...
@@ -652,17 +652,20 @@ class OfficeRoomService
}
/*
* 房源列表
*
* @param $params
* @param int $is_total
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* User HuJun
* Date 19-6-
2 下午2:26
* Date 19-6-
3 上午10:31
*/
public
function
getRoomList
(
$params
)
{
public
function
getRoomList
(
$params
,
$is_total
=
0
)
{
$page_no
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$page_size
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$result
[
'status'
]
=
'fail'
;
$result
[
'msg'
]
=
''
;
$result
[
'data'
]
=
[];
$where
=
$this
->
buildParams
(
$params
);
...
...
@@ -685,47 +688,56 @@ class OfficeRoomService
$agent_where
[
'a.is_del'
]
=
0
;
}
//盘方搜索
if
(
!
empty
(
$agent_where
))
{
$agent_arr
=
$this
->
agent_room
->
getAgentsByRoomColumn
(
'houses_id'
,
$agent_where
);
try
{
//盘方搜索
if
(
!
empty
(
$agent_where
))
{
$agent_arr
=
$this
->
agent_room
->
getAgentsByRoomColumn
(
'houses_id'
,
$agent_where
);
if
(
empty
(
$agent_arr
))
{
$data
[
'data'
][
'list'
]
=
[]
;
$data
[
'data'
][
'total'
]
=
0
;
return
$this
->
response
(
200
,
''
,
$data
);
}
else
{
$agent_str
=
implode
(
','
,
$agent_arr
)
;
$where
[]
=
[
'EXP'
,
"id in (
{
$agent_str
}
)"
];
if
(
empty
(
$agent_arr
))
{
$result
[
'status'
]
=
'successful'
;
return
$result
;
}
else
{
$agent_str
=
implode
(
','
,
$agent_arr
);
$where
[]
=
[
'EXP'
,
"id in (
{
$agent_str
}
)"
]
;
}
}
}
/*盘方 end*/
/*盘方 end*/
/*房东手机号搜索 start*/
if
(
$params
[
'landlord_phone'
]
!=
NULL
)
{
if
(
strlen
(
$params
[
'landlord_phone'
])
!=
11
)
{
$result
[
'msg'
]
=
'房东手机不足11位'
;
return
$result
;
}
$landlord_where
[
'phone'
]
=
[
'LIKE'
,
'%'
.
$params
[
'landlord_phone'
]
.
'%'
];
$landlord_where
[
'status'
]
=
0
;
$landlord_arr
=
$this
->
landlord_phone
->
getList
(
1
,
1000
,
''
,
'house_id'
,
$landlord_where
);
/*房东手机号搜索 start*/
if
(
$params
[
'landlord_phone'
]
!=
NULL
)
{
if
(
strlen
(
$params
[
'landlord_phone'
])
!=
11
)
{
$result
[
'msg'
]
=
'房东手机不足11位'
;
return
$result
;
}
$landlord_where
[
'phone'
]
=
[
'LIKE'
,
'%'
.
$params
[
'landlord_phone'
]
.
'%'
];
$landlord_where
[
'status'
]
=
0
;
$landlord_arr
=
$this
->
landlord_phone
->
getList
(
1
,
1000
,
''
,
'house_id'
,
$landlord_where
);
if
(
empty
(
$landlord_arr
))
{
$result
[
'status'
]
=
'successful'
;
return
$result
;
}
else
{
$landlord_house_id
=
[];
foreach
(
$landlord_arr
as
$k
=>
$v
)
{
$landlord_house_id
[]
=
$v
[
'house_id'
];
if
(
empty
(
$landlord_arr
))
{
$result
[
'status'
]
=
'successful'
;
return
$result
;
}
else
{
$landlord_house_id
=
[];
foreach
(
$landlord_arr
as
$k
=>
$v
)
{
$landlord_house_id
[]
=
$v
[
'house_id'
];
}
$landlord_str
=
implode
(
','
,
$landlord_house_id
);
$where
[]
=
[
'EXP'
,
"id in (
{
$landlord_str
}
)"
];
}
$landlord_str
=
implode
(
','
,
$landlord_house_id
);
$where
[]
=
[
'EXP'
,
"id in (
{
$landlord_str
}
)"
];
}
/*房东手机号搜索 end*/
$field
=
'a.id'
;
$result
[
'data'
]
=
$this
->
m_office_room
->
getRoomAgent
(
$page_no
,
$page_size
,
$field
,
$where
);
if
(
$is_total
)
{
$result
[
'total'
]
=
$this
->
m_office_room
->
getRoomAgentTotal
(
$where
);
}
}
catch
(
\Exception
$e
)
{
$result
[
'msg'
]
=
$e
->
getMessage
();
}
/*房东手机号搜索 end*/
$field
=
''
;
$this
->
m_office_room
->
getRoomAgent
(
$page_no
,
$page_size
,
$field
,
$where
)
;
return
$result
;
}
/**
...
...
application/model/OfficeGRoom.php
View file @
a3132feb
...
...
@@ -261,4 +261,26 @@ class OfficeGRoom extends BaseModel
->
page
(
$page_no
)
->
select
();
}
/**
* @param $page_no
* @param $page_size
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* User HuJun
* Date 19-6-2 下午1:57
*/
public
function
getRoomAgentTotal
(
$where
)
{
return
$this
->
alias
(
'a'
)
->
join
(
'office_g_room_to_agent b'
,
'a.id = b.house_id'
,
'left'
)
->
join
(
'a_agents b'
,
'b.agent_id = b.id'
,
'left'
)
->
join
(
'office_g_building c'
,
'a.building_id = c.id'
,
'left'
)
->
where
(
$where
)
->
count
(
'a.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