Commit 045a5371 authored by hujun's avatar hujun

实收统计

parent c76783df
...@@ -1509,7 +1509,8 @@ class Finance extends Basic ...@@ -1509,7 +1509,8 @@ class Finance extends Basic
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$operation_start_data = $operation_end_data = $income_date = $operation_date = ''; $operation_start_data = $operation_end_data = $income_date = $operation_date = '';
$where = []; $where['a.confirm_status'] = 1;
/**收佣日期 start**/ /**收佣日期 start**/
if (!empty($this->params['income_start_date']) && empty($this->params['income_end_date'])) { if (!empty($this->params['income_start_date']) && empty($this->params['income_end_date'])) {
$where[0] = ['EXP', "b.income_time > '{$this->params['income_start_date']}' OR c.operation_date > '{$this->params['income_start_date']}'"]; $where[0] = ['EXP', "b.income_time > '{$this->params['income_start_date']}' OR c.operation_date > '{$this->params['income_start_date']}'"];
...@@ -1578,18 +1579,16 @@ class Finance extends Basic ...@@ -1578,18 +1579,16 @@ class Finance extends Basic
$m_partial = new OPartialCommission(); $m_partial = new OPartialCommission();
$m_store = new AStore(); $m_store = new AStore();
$m_agent = new AAgents(); $m_agent = new AAgents();
$where['c.is_del'] = 0;
if (empty($this->params['excel']) && $this->params['excel'] != 1) { if (empty($this->params['excel']) && $this->params['excel'] != 1) {
$m_tax = new OTaxes(); $m_tax = new OTaxes();
$taxes_where['a.father_id'] = ['>', 0]; $taxes_where['a.father_id'] = ['>', 0];
$taxes_where['a.is_del'] = 0; $taxes_where['a.is_del'] = 0;
// $taxes_where['b.status'] = ['IN', '10,11,13'];
$taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]]; $taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]];
$data['data']['total_taxes'] = $m_tax->sumBargainFee('a.fee', $taxes_where);; $data['data']['total_taxes'] = $m_tax->sumBargainFee('a.fee', $taxes_where);;
if (!empty($this->params['confirm_date'])) { if (!empty($this->params['confirm_date'])) {
$where['a.confirm_date'] = ['<=', $this->params['confirm_date'].' 23:59:59']; $where['a.confirm_date'] = ['<=', $this->params['confirm_date'].' 23:59:59'];
$where['a.confirm_status'] = 1;
} }
$list = $m_partial->getCommissionTotalList($pageNo, $pageSize, $fields, $where, $operation_start_data, $operation_end_data); $list = $m_partial->getCommissionTotalList($pageNo, $pageSize, $fields, $where, $operation_start_data, $operation_end_data);
...@@ -1611,6 +1610,7 @@ class Finance extends Basic ...@@ -1611,6 +1610,7 @@ class Finance extends Basic
$where[1] =['EXP', "e.create_time BETWEEN '{$this->params['bargain_start_date']} 00:00:00' AND '{$this->params['bargain_end_date']} 23:59:59'"]; $where[1] =['EXP', "e.create_time BETWEEN '{$this->params['bargain_start_date']} 00:00:00' AND '{$this->params['bargain_end_date']} 23:59:59'"];
} }
$where['e.status'] = ['IN', '10,11,13']; $where['e.status'] = ['IN', '10,11,13'];
unset($where['c.is_del']);
$data['data']['total_money'] = $m_partial->getCommissionTotalInfo('a.practical_fee', $where); $data['data']['total_money'] = $m_partial->getCommissionTotalInfo('a.practical_fee', $where);
} else { } else {
//导出Excel //导出Excel
......
...@@ -250,7 +250,7 @@ class OPartialCommission extends BaseModel ...@@ -250,7 +250,7 @@ class OPartialCommission extends BaseModel
} }
$taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]]; $taxes_where['a.operation_date'] = ['between', [$operation_start_data, $operation_end_data]];
$taxes_where['a.agent_id'] = $v['agent_id']; $taxes_where['b.agent_id'] = $v['agent_id'];
$result[$k]['fee'] = $m_tax->sumBargainFee('a.fee', $taxes_where); $result[$k]['fee'] = $m_tax->sumBargainFee('a.fee', $taxes_where);
$result[$k]['agent_id'] = $v['agent_id']; $result[$k]['agent_id'] = $v['agent_id'];
$result[$k]['name'] = $v['name']; $result[$k]['name'] = $v['name'];
......
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