Commit 575efd4a authored by hujun's avatar hujun

约带看时间

parent 75acbd13
...@@ -30,7 +30,7 @@ class Report extends Basic ...@@ -30,7 +30,7 @@ class Report extends Basic
$m_report = new OReportModel(); $m_report = new OReportModel();
$data['code'] = 200; $data['code'] = 200;
$data['msg'] = ""; $data['msg'] = "";
$where = []; $where["a.status"] = 0;
if (!empty($this->params['start_time']) && empty($this->params['end_time'])) { if (!empty($this->params['start_time']) && empty($this->params['end_time'])) {
$where['a.create_time'] = ['> time', $this->params['start_time'] . ' 00:00:00']; $where['a.create_time'] = ['> time', $this->params['start_time'] . ' 00:00:00'];
} }
......
...@@ -646,34 +646,11 @@ class OReportModel extends Model ...@@ -646,34 +646,11 @@ class OReportModel extends Model
*/ */
public function getReportList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '') public function getReportList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '')
{ {
$where_ = [];
if (isset($params["agent_id"])) {
$where_["a.report_agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["a.create_time"] = $params["create_time"];
}
if (isset($params["house_ids"])) {
$where_["b.house_id"] = array( "in", $params["house_ids"] );
}
if (isset($params['report_agent_name'])) {
$where_["a.report_agent_name"] = $params['report_agent_name'];
}
if (isset($params['report_agent_phone'])) {
$where_["a.report_agent_phone"] = $params['report_agent_phone'];
}
if (isset($params['internal_title'])) {
$where_["c.internal_title"] = $params['internal_title'];
}
if (isset($params['user_phone'])) {
$where_["a.user_phone"] = $params['user_phone'];
}
$where_["a.status"] = 0;
$result = $this->db->field($field) $result = $this->db->field($field)
->alias("a") ->alias("a")
->join("o_order b", "a.id = b.f_id", "left") ->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left") ->join("g_houses c", "b.house_id = c.id", "left")
->where($where_) ->where($params)
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->order($order_) ->order($order_)
...@@ -689,33 +666,10 @@ class OReportModel extends Model ...@@ -689,33 +666,10 @@ class OReportModel extends Model
*/ */
public function getAddReportListTotal($params) public function getAddReportListTotal($params)
{ {
$where_["a.status"] = 0;
if (isset($params["agent_id"])) {
$where_["a.report_agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["a.create_time"] = $params["create_time"];
}
if (isset($params["house_ids"])) {
$where_["b.house_id"] = array("in", $params["house_ids"]);
}
if (isset($params['report_agent_name'])) {
$where_["a.report_agent_name"] = $params['report_agent_name'];
}
if (isset($params['report_agent_phone'])) {
$where_["a.report_agent_phone"] = $params['report_agent_phone'];
}
if (isset($params['internal_title'])) {
$where_["c.internal_title"] = $params['internal_title'];
}
if (isset($params['user_phone'])) {
$where_["a.user_phone"] = $params['user_phone'];
}
return $this->db->alias("a") return $this->db->alias("a")
->join("o_order b", "a.id = b.f_id", "left") ->join("o_order b", "a.id = b.f_id", "left")
->join("g_houses c", "b.house_id = c.id", "left") ->join("g_houses c", "b.house_id = c.id", "left")
->where($where_) ->where($params)
->count('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