Commit cfe4eeb1 authored by clone's avatar clone

1

parent e94beade
......@@ -1203,10 +1203,15 @@ class OfficeRoomService
if (isset($params['disc'])) {
$where['b.disc'] = $params['disc']; //区
}
if (isset($params['id'])) {
$where['a.id'] = $params['id']; //楼盘id
}
if (isset($params['title'])) {
$where['b.title'] = ['LIKE', '%' . $params['title'] . '%']; //楼盘名
}
if (isset($params['address'])) {
$where['b.address'] = ['LIKE', '%' . $params['address'] . '%']; //楼盘地址
}
if (isset($params['id'])) {
$where['a.id'] = $params['id'];
......@@ -1280,6 +1285,17 @@ class OfficeRoomService
}
}
if(isset($params['landlord_phone'])){
$ids = $this->getBuildingByLandlordPhone($params['landlord_phone']);
if($ids){
$where['a.id'] = array("in",$ids); //房东手机号 office_g_landlord_phone
}else{
$result['status'] = 'successful';
$result['msg'] = "request null";
return $result;
}
}
$field = 'a.id,b.disc,b.title,b.address,c.name as business_name,a.building_id,a.price,a.price_total,b.status,a.is_rent';
try {
$data = $this->m_office_room->getRoomBuilding($page_no, $page_size, $order, $field, $where);
......@@ -1329,6 +1345,29 @@ class OfficeRoomService
return $ids;
}
/**
* 根据房东手机号搜索
* @param $landlordPhone
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
private function getBuildingByLandlordPhone($landlordPhone){
$landlordPhoneModel = new OfficeGLandlordPhone();
$field = "house_id";
$params["phone"] = array("like", "%" . trim($landlordPhone) . "%");
$roomArr = $landlordPhoneModel->getAllList($field,$params);
$ids = "";
if (count($roomArr) > 0) {
foreach ($roomArr as $item) {
$ids .= $item["id"] . ",";
}
$ids = rtrim($ids, ",");
}
return $ids;
}
/**
* 标签处理
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment