Commit 1d9e1c51 authored by hujun's avatar hujun

成交报告-增加搜索条件-表别名

parent 2dcacb31
...@@ -101,19 +101,19 @@ class Finance extends Basic ...@@ -101,19 +101,19 @@ class Finance extends Basic
} }
if (!empty($this->params['district_id'])) { if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id']; $where['f.district_id'] = $this->params['district_id'];
} }
if (!empty($this->params['store_id'])) { if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id']; $where['f.store_id'] = $this->params['store_id'];
} }
if (!empty($this->params['agent_phone'])) { if (!empty($this->params['agent_phone'])) {
$where['e.phone'] = ['LIKE', '%'.$this->params['agent_phone'].'%']; $where['f.phone'] = ['LIKE', '%'.$this->params['agent_phone'].'%'];
} }
if (!empty($this->params['agent_name'])) { if (!empty($this->params['agent_name'])) {
$where['e.name'] = ['LIKE', '%'.$this->params['agent_name'].'%']; $where['f.name'] = ['LIKE', '%'.$this->params['agent_name'].'%'];
} }
switch ($check_status) { switch ($check_status) {
......
...@@ -352,7 +352,7 @@ class OBargainModel extends Model ...@@ -352,7 +352,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left') ->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left') ->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left') ->join('a_agents f', 'b.report_agent_id=f.id','left')
->where($params) ->where($params)
->having('count(e.order_id) = 1') ->having('count(e.order_id) = 1')
->order($order_) ->order($order_)
...@@ -365,7 +365,7 @@ class OBargainModel extends Model ...@@ -365,7 +365,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left') ->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left') ->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left') ->join('a_agents f', 'b.report_agent_id=f.id','left')
->where($params) ->where($params)
->group('a.id') ->group('a.id')
->order($order_) ->order($order_)
...@@ -412,7 +412,7 @@ class OBargainModel extends Model ...@@ -412,7 +412,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left') ->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left') ->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left') ->join('a_agents f', 'b.report_agent_id=f.id','left')
->where($params) ->where($params)
->having('count(e.order_id) = 1') ->having('count(e.order_id) = 1')
->group('e.order_id') ->group('e.order_id')
...@@ -422,7 +422,7 @@ class OBargainModel extends Model ...@@ -422,7 +422,7 @@ class OBargainModel extends Model
->join('o_report b', 'a.report_id = b.id', 'left') ->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left') ->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.report_agent_id=e.id','left') ->join('a_agents f', 'b.report_agent_id=f.id','left')
->where($params) ->where($params)
->group('a.id') ->group('a.id')
->count(); ->count();
......
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