Commit 73399ef3 authored by hujun's avatar hujun

实收明细分佣列表修改

parent 4fa680d0
......@@ -701,39 +701,15 @@ class Finance extends Basic
$where['a.is_del'] = $select = 0;
if (!empty($this->params['create_time']) && empty($this->params['end_time'])) {
$income_where['income_time'] = [ '>= time', $this->params['create_time'] . ' 00:00:00' ];
$where['f.income_time'] = [ '>= time', $this->params['create_time'] . ' 00:00:00' ];
}
if (!empty($this->params['end_time']) && empty($this->params['create_time'])) {
$income_where['income_time'] = [ '<= time', $this->params['end_time'] . ' 23:59:59' ];
$where['f.income_time'] = [ '<= time', $this->params['end_time'] . ' 23:59:59' ];
}
if (!empty($this->params['end_time']) && !empty($this->params['create_time'])) {
$income_where['income_time'] = [ 'between time', [ $this->params['create_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59' ] ];
}
if (!empty($income_where)) {
$m_real = new ORealIncome();
$bargain_arr = $m_real->getRealIncomeBargain('bargain_id', $income_where);
if ($bargain_arr['status'] == 'successful') {
if (empty($bargain_arr['data'])) {
return $this->response(200, '');
}
foreach ($bargain_arr['data'] as $v) {
$bargain_id[] = $v['bargain_id'];
}
if (!empty($bargain_id)) {
$bargain_id_string = implode(',', $bargain_id);
$where[] = ['EXP', 'b.id in ('.$bargain_id_string.') or b.father_id in ('.$bargain_id_string.')'];
}
$select = 1;
} else {
return $this->response(101, '内部错误:'.$bargain_arr['msg']);
}
$where['f.income_time'] = [ 'between time', [ $this->params['create_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59' ] ];
}
if (!empty($this->params['internal_address'])) {
......@@ -799,38 +775,15 @@ class Finance extends Basic
$where['a.confirm_status'] = 1;
$where['a.is_del'] = 0;
if (!empty($this->params['create_time']) && empty($this->params['end_time'])) {
$income_where['income_time'] = [ '>= time', $this->params['create_time'] . ' 00:00:00' ];
$where['f.income_time'] = [ '>= time', $this->params['create_time'] . ' 00:00:00' ];
}
if (!empty($this->params['end_time']) && empty($this->params['create_time'])) {
$income_where['income_time'] = [ '<= time', $this->params['end_time'] . ' 23:59:59' ];
$where['f.income_time'] = [ '<= time', $this->params['end_time'] . ' 23:59:59' ];
}
if (!empty($this->params['end_time']) && !empty($this->params['create_time'])) {
$income_where['income_time'] = [ 'between time', [ $this->params['create_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59' ] ];
}
if (!empty($income_where)) {
$m_real = new ORealIncome();
$bargain_arr = $m_real->getRealIncomeBargain('bargain_id', $income_where);
if ($bargain_arr['status'] == 'successful') {
if (empty($bargain_arr['data'])) {
return $this->response(200, '');
}
foreach ($bargain_arr['data'] as $v) {
$bargain_id[] = $v['bargain_id'];
}
if (!empty($bargain_id)) {
$bargain_id_string = implode(',', $bargain_id);
$where[] = ['EXP', 'b.id in ('.$bargain_id_string.') or b.father_id in ('.$bargain_id_string.')'];
}
} else {
return $this->response(101, '内部错误:'.$bargain_arr['msg']);
}
$where['f.income_time'] = [ 'between time', [ $this->params['create_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59' ] ];
}
if (!empty($this->params['internal_address'])) {
......
......@@ -119,6 +119,7 @@ class OPartialCommission extends BaseModel
->join('o_order c', 'b.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left')
->join('a_agents e', 'b.agent_id = e.id', 'left')
->join('o_real_income f', 'a.real_income_id = f.id', 'left')
->where($where)
->order($order_)
->limit($pageSize)
......
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