Commit 62f54848 authored by clone's avatar clone

盘方部门门店姓名搜索

parent 0f4d7ccb
...@@ -76,6 +76,12 @@ class Shop extends Basic ...@@ -76,6 +76,12 @@ class Shop extends Basic
"start_time" => "2018-05-25", "start_time" => "2018-05-25",
"end_time" => "2018-05-30", "end_time" => "2018-05-30",
"landlord_phone" => "17621970093", "landlord_phone" => "17621970093",
//新增于180919
"p_district_id" => 1,
"p_store_id" => 1,
"p_agent_name" => "张三",
"pageNo" => 1, "pageNo" => 1,
"pageSize" => 15 "pageSize" => 15
);*/ );*/
...@@ -199,16 +205,20 @@ class Shop extends Basic ...@@ -199,16 +205,20 @@ class Shop extends Basic
} }
$houseIds = ""; $houseIds = "";
if (isset($params['house_id'])) { if (isset($params['house_id'])) {
$houseIds = $params['house_id']; $houseIds = $params['house_id'];
} else { } elseif (isset($params['landlord_phone'])) {
if (isset($params['landlord_phone'])) {
$houseIds = $this->returnHouseId($params['landlord_phone']); $houseIds = $this->returnHouseId($params['landlord_phone']);
if (empty($houseIds)) { if (empty($houseIds)) {
return $this->response("200", "此条件没有找到数据"); return $this->response("200", "此条件没有找到数据");
} }
} elseif (isset($params['p_district_id']) && isset($params['p_store_id']) && isset($params['p_agent_name'])) {
$houseIds = $this->returnHouseIdByPanParty($params['p_district_id'], $params['p_store_id'], $params['p_agent_name']);
if (empty($houseIds)) {
return $this->response("200", "此条件没有找到数据");
} }
} }
if (!empty($houseIds)) { if (!empty($houseIds)) {
$conditions['id'] = array( "in", $houseIds ); $conditions['id'] = array( "in", $houseIds );
...@@ -259,6 +269,29 @@ class Shop extends Basic ...@@ -259,6 +269,29 @@ class Shop extends Basic
return $ids; return $ids;
} }
private function returnHouseIdByPanParty($p_district_id, $p_store_id, $p_agent_name)
{
$agentModel = new AAgents();
$params["district_id"] = $p_district_id;
$params["store_id"] = $p_store_id;
$params["name"] = array( "like", "%" . trim($p_agent_name) . "%" );
$agentArr = $agentModel->getAgentById("id", $params);
$ids = "";
if (count($agentArr) < 1) {
return $ids;
}
$verifyService = new VerifyService();
$houseIds = $verifyService->getPanpartyByAgentId($agentArr[0]["id"]);
if (count($houseIds) > 0) {
foreach ($houseIds as $item) {
$ids .= $item["house_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