Commit e60a3fd3 authored by hujun's avatar hujun

实收统计3

parent 813259b0
...@@ -1564,17 +1564,17 @@ class Finance extends Basic ...@@ -1564,17 +1564,17 @@ class Finance extends Basic
/**部门id**/ /**部门id**/
if (!empty($this->params['district_id'])) { if (!empty($this->params['district_id'])) {
$where['d.district_id'] = $this->params['district_id']; $taxes_where['c.district_id'] = $where['d.district_id'] = $this->params['district_id'];
} }
/**门店名**/ /**门店名**/
if (!empty($this->params['store_id'])) { if (!empty($this->params['store_id'])) {
$where['d.store_id'] = $this->params['store_id']; $taxes_where['c.store_id'] = $where['d.store_id'] = $this->params['store_id'];
} }
/**经纪人手机号**/ /**经纪人手机号**/
if (!empty($this->params['agent_id'])) { if (!empty($this->params['agent_id'])) {
$where['a.agent_id'] = $taxes_where['a.agent_id'] = $this->params['agent_id']; $taxes_where['c.agent_id'] = $taxes_where['a.agent_id'] = $this->params['agent_id'];
} }
$fields = 'sum( a.practical_fee ) as practical_fee,sum( a.real_fee ) as real_fee,'; $fields = 'sum( a.practical_fee ) as practical_fee,sum( a.real_fee ) as real_fee,';
......
...@@ -298,6 +298,7 @@ class OTaxes extends BaseModel ...@@ -298,6 +298,7 @@ class OTaxes extends BaseModel
return $this->field($field) return $this->field($field)
->alias('a') ->alias('a')
->join('o_bargain b', 'a.bargain_id = b.id', 'left') ->join('o_bargain b', 'a.bargain_id = b.id', 'left')
->join('a_agents c', 'b.agent_id = c.id', 'left')
->where($where) ->where($where)
->sum($field); ->sum($field);
} }
......
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