Commit f643b5e7 authored by hujun's avatar hujun

搜索

parent 614d1329
......@@ -698,42 +698,51 @@ class Finance extends Basic
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where = [];
$where['a.confirm_status'] = 1;
$where['a.is_del'] = 0;
$where['a.is_del'] = $select = 0;
if (!empty($this->params['create_time']) && empty($this->params['end_time'])) {
$where['f.income_time'] = [ '>= time', $this->params['create_time'] . ' 00:00:00' ];
$select = 1;
}
if (!empty($this->params['end_time']) && empty($this->params['create_time'])) {
$where['f.income_time'] = [ '<= time', $this->params['end_time'] . ' 23:59:59' ];
$select = 1;
}
if (!empty($this->params['end_time']) && !empty($this->params['create_time'])) {
$where['f.income_time'] = [ 'between time', [ $this->params['create_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59' ] ];
$select = 1;
}
if (!empty($this->params['internal_address'])) {
$where['d.internal_address'] = [ 'like', '%' . $this->params['internal_address'] . '%' ];
$select = 1;
}
if (!empty($this->params['partial_id'])) {
$where['e.id'] = $this->params['partial_id'];
$select = 1;
}
if (!empty($this->params['house_number'])) {
$where['b.house_number'] = [ 'like', '%' . $this->params['house_number'] . '%' ];
$select = 1;
}
if (!empty($this->params['bargain_id'])) {
$where[] = [ 'EXP', 'b.id =' . $this->params['bargain_id'] . ' or father_id=' . $this->params['bargain_id'] ];
$select = 1;
}
if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id'];
$select = 1;
}
if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id'];
$select = 1;
}
$field = 'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,d.internal_address,b.agent_id,b.house_number,b.father_id,b.order_id,a.real_income_id';
......@@ -743,7 +752,7 @@ class Finance extends Basic
$data['data']['list'] = $m_commission->getCommissionBargainList($pageNo, $pageSize, 'a.id desc', $field, $where);
$data['data']['total'] = $m_commission->getCommissionBargainListTotal($where);
if (!empty($where)) {
if ($select) {
$data['data']['total_money'] = $m_commission->totalMoney($where); //实收总计
} else {
$data['data']['total_money'] = '';
......
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