Commit 18157b7d authored by hujun's avatar hujun

办公楼税费

parent c4b18207
...@@ -148,7 +148,7 @@ class OfficeFinance extends Basic ...@@ -148,7 +148,7 @@ class OfficeFinance extends Basic
} }
if (!empty($this->params['internal_address'])) { if (!empty($this->params['internal_address'])) {
$where['d.internal_address'] = [ 'like', '%' . $this->params['internal_address'] . '%' ]; $where['f.address'] = [ 'like', '%' . $this->params['internal_address'] . '%' ];
} }
if (!empty($this->params['phone'])) { if (!empty($this->params['phone'])) {
...@@ -168,7 +168,7 @@ class OfficeFinance extends Basic ...@@ -168,7 +168,7 @@ class OfficeFinance extends Basic
} }
$m_fee = new OfficeOTaxes(); $m_fee = new OfficeOTaxes();
$fields = 'a.id,a.operation_date,e.name,e.phone,a.fee,b.house_number,d.internal_address,a.agent_id,b.father_id,b.id as bargain_id,b.order_id'; $fields = 'a.id,a.operation_date,e.name,e.phone,a.fee,b.house_number,f.address as internal_address,a.agent_id,b.father_id,b.id as bargain_id,b.order_id';
if ($this->params['excel'] != 1) { if ($this->params['excel'] != 1) {
$data['data']['list'] = $m_fee->getTaxesList($pageNo, $pageSize, 'a.id desc', $fields, $where); $data['data']['list'] = $m_fee->getTaxesList($pageNo, $pageSize, 'a.id desc', $fields, $where);
$data['data']['total'] = $m_fee->getTaxesListTotal($where); $data['data']['total'] = $m_fee->getTaxesListTotal($where);
......
...@@ -222,9 +222,10 @@ class OfficeOTaxes extends BaseModel ...@@ -222,9 +222,10 @@ class OfficeOTaxes extends BaseModel
public function getTaxesList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '') public function getTaxesList($pageNo = 1, $pageSize = 15, $order_ = 'a.id desc', $field = '', $params = '')
{ {
$data = $this->field($field)->alias('a') $data = $this->field($field)->alias('a')
->join('o_bargain b', 'a.bargain_id = b.id', 'left') ->join('office_o_bargain b', 'a.bargain_id = b.id', 'left')
->join('o_order c', 'b.order_id = c.id', 'left') ->join('office_o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_g_building f', 'd.building_id = f.id', 'left')
->join('a_agents e', 'a.agent_id = e.id', 'left') ->join('a_agents e', 'a.agent_id = e.id', 'left')
->where($params) ->where($params)
->order($order_) ->order($order_)
...@@ -251,10 +252,11 @@ class OfficeOTaxes extends BaseModel ...@@ -251,10 +252,11 @@ class OfficeOTaxes extends BaseModel
public function getTaxesListTotal($params) public function getTaxesListTotal($params)
{ {
$data = $this->alias('a') $data = $this->alias('a')
->join('o_bargain b', 'a.bargain_id = b.id', 'left') ->join('office_o_bargain b', 'a.bargain_id = b.id', 'left')
->join('o_order c', 'b.order_id = c.id', 'left') ->join('office_o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.agent_id = e.id', 'left') ->join('office_g_building f', 'd.building_id = f.id', 'left')
->join('a_agents e', 'a.agent_id = e.id', 'left')
->where($params) ->where($params)
->count(); ->count();
return $data; return $data;
...@@ -268,9 +270,10 @@ class OfficeOTaxes extends BaseModel ...@@ -268,9 +270,10 @@ class OfficeOTaxes extends BaseModel
public function getTaxesListTotalFee($params) public function getTaxesListTotalFee($params)
{ {
$data = $this->alias('a') $data = $this->alias('a')
->join('o_bargain b', 'a.bargain_id = b.id', 'left') ->join('office_o_bargain b', 'a.bargain_id = b.id', 'left')
->join('o_order c', 'b.order_id = c.id', 'left') ->join('office_o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_g_building f', 'd.building_id = f.id', 'left')
->join('a_agents e', 'a.agent_id = e.id', 'left') ->join('a_agents e', 'a.agent_id = e.id', 'left')
->where($params) ->where($params)
->sum("a.fee"); ->sum("a.fee");
......
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