Commit 5295bd6a authored by hujun's avatar hujun

房源搜索

parent 1afc067c
......@@ -823,25 +823,21 @@ class OfficeRoomService
/*盘方 start*/
if ($params['dish_id'] != NULL) {
$agent_where['a.agent_id'] = $params['dish_id'];
$agent_where['a.type'] = 2;
$agent_where['a.is_del'] = 0;
}
if ($params['dish_store_id'] != NULL) {
$agent_where['b.store_id'] = $params['dish_store_id'];
$agent_where['a.type'] = 2;
$agent_where['a.is_del'] = 0;
}
if ($params['dish_district_id'] != NULL) {
$agent_where['b.district_id'] = $params['dish_district_id'];
$agent_where['a.type'] = 2;
$agent_where['a.is_del'] = 0;
}
try {
//盘方搜索
if (!empty($agent_where)) {
$agent_where['a.type'] = 2;
$agent_where['a.is_del'] = 0;
$agent_arr = $this->agent_room->getAgentsByRoomColumn('house_id', $agent_where);
if (empty($agent_arr)) {
......@@ -849,7 +845,7 @@ class OfficeRoomService
return $result;
} else {
$agent_str = implode(',', $agent_arr);
$where[] = ['EXP', "id in ({$agent_str})"];
$where[] = ['EXP', "a.id in ({$agent_str})"];
}
}
/*盘方 end*/
......
......@@ -309,12 +309,12 @@ class OfficeGRoom extends BaseModel
return $this->alias('a')
->field($field)
->join('office_g_building b', 'a.building_id = b.id', 'left')
->join('office_g_room_to_agent c', 'a.id = c.house_id', 'left')
->join('a_agents d', 'c.agent_id = d.id', 'left')
// ->join('office_g_room_to_agent c', 'a.id = c.house_id', 'left')
// ->join('a_agents d', 'c.agent_id = d.id', 'left')
->where($where)
->limit($page_size)
->page($page_no)
->group('a.id')
// ->group('a.id')
->order('a.id desc')
->select();
}
......@@ -335,10 +335,10 @@ class OfficeGRoom extends BaseModel
{
return $this->alias('a')
->join('office_g_building b', 'a.building_id = b.id', 'left')
->join('office_g_room_to_agent c', 'a.id = c.house_id', 'left')
->join('a_agents d', 'c.agent_id = d.id', 'left')
// ->join('office_g_room_to_agent c', 'a.id = c.house_id', 'left')
// ->join('a_agents d', 'c.agent_id = d.id', 'left')
->where($where)
->group('a.id')
// ->group('a.id')
->count('a.id');
}
......
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