Commit f05282c7 authored by zhuwei's avatar zhuwei

约带看筛选

parent 004e8bf0
...@@ -280,6 +280,7 @@ class OReportModel extends Model ...@@ -280,6 +280,7 @@ class OReportModel extends Model
if (!empty($params['report_agent_phone'])) { if (!empty($params['report_agent_phone'])) {
$conditions[] = "aaa.report_agent_phone LIKE '%".$params['report_agent_phone']."%'"; $conditions[] = "aaa.report_agent_phone LIKE '%".$params['report_agent_phone']."%'";
} }
// 商铺名 // 商铺名
if (!empty($params['house_title'])) { if (!empty($params['house_title'])) {
$conditions[] = "aaa.house_title LIKE '%".$params['house_title']."%'"; $conditions[] = "aaa.house_title LIKE '%".$params['house_title']."%'";
...@@ -289,11 +290,44 @@ class OReportModel extends Model ...@@ -289,11 +290,44 @@ class OReportModel extends Model
$conditions[] = "aaa.user_phone LIKE '%".$params['user_phone']."%'"; $conditions[] = "aaa.user_phone LIKE '%".$params['user_phone']."%'";
} }
if (!empty($params['order_id'])) { if (!empty($params['order_id'])) {
$conditions[] = "aaa.order_id =".$params['order_id']; $conditions[] = "aaa.order_id =".$params['order_id'];
} }
//城市 '省'
if (!empty($params['province'])) {
$conditions[] = "aaa.province = {$params['province']}" ;
}
//城市 '市'
if (!empty($params['city'])) {
$conditions[] = "aaa.city = {$params['city']}" ;
}
//城市 '所在区'
if (!empty($params['disc'])) {
$conditions[] = "aaa.disc = {$params['disc']}" ;
}
//商铺地址
if (!empty($params['internal_address'])) {
$conditions[] = "aaa.internal_address = {$params['internal_address']}" ;
}
//商铺ID
if (!empty($params['house_id'])) {
$conditions[] = "aaa.user_id = {$params['house_id']}" ;
}
//客户ID
if (!empty($params['user_id'])) {
$conditions[] = "aaa.user_id = {$params['user_phone']}" ;
}
#组装搜索where条件 #组装搜索where条件
if ($conditions) { if ($conditions) {
$where_params = 'WHERE ' . implode(" AND ", $conditions); $where_params = 'WHERE ' . implode(" AND ", $conditions);
...@@ -404,12 +438,16 @@ class OReportModel extends Model ...@@ -404,12 +438,16 @@ class OReportModel extends Model
$result = $this->db->query($sql); $result = $this->db->query($sql);
return $result; return $result;
default: default:
$field = "a.id,a.user_id,a.report_agent_name,a.report_agent_phone,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title,c.province,c.city,c.disc,c.internal_address";
$sql = "SELECT * FROM $sql = "SELECT * FROM
((SELECT ((SELECT
$filed $filed
FROM FROM
`o_report` `a` `o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id` LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `g_houses` `c` ON `b`.`house_id` = `c`.`id`
WHERE WHERE
$report_agent_str $report_agent_str
AND `a`.`status` = 0 AND `a`.`status` = 0
...@@ -420,6 +458,7 @@ class OReportModel extends Model ...@@ -420,6 +458,7 @@ class OReportModel extends Model
FROM FROM
`o_report` `a` `o_report` `a`
LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id` LEFT JOIN `o_order` `b` ON `a`.`id` = `b`.`f_id`
LEFT JOIN `g_houses` `c` ON `b`.`house_id` = `c`.`id`
WHERE WHERE
$house_str $house_str
AND `a`.`status` = 0 AND `a`.`status` = 0
......
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