Commit d37f36d4 authored by hujun's avatar hujun

汇总修改

parent 2472da0f
...@@ -327,11 +327,17 @@ class OPartialCommission extends BaseModel ...@@ -327,11 +327,17 @@ class OPartialCommission extends BaseModel
//税费 //税费
$data[$k]['fee'] = $m_tax->where('operation_date', 'between time', [ $operation_start_data, $operation_end_data ]) $data[$k]['fee'] = $m_tax->where('operation_date', 'between time', [ $operation_start_data, $operation_end_data ])
->where('agent_id', $v['agent_id'])->sum('fee'); ->where('agent_id', $v['agent_id'])
->where('is_del',0)
->sum('fee');
//去除多次应分佣金 //去除多次应分佣金
$should_commission = $this->where('confirm_date', 'between time', [ $operation_start_data, $operation_end_data ]) $should_commission = $this->where('confirm_date', 'between time', [ $operation_start_data, $operation_end_data ])
->where('agent_id', $v['agent_id'])->group('bargain_id')->column('should_commission'); ->where('agent_id', $v['agent_id'])
->where('confirm_status', 1)
->where('is_del', 0)
->group('bargain_id')
->column('should_commission');
$data[$k]['should_commission'] = 0; $data[$k]['should_commission'] = 0;
foreach ($should_commission as $kk => $vv) { foreach ($should_commission as $kk => $vv) {
...@@ -341,8 +347,12 @@ class OPartialCommission extends BaseModel ...@@ -341,8 +347,12 @@ class OPartialCommission extends BaseModel
$field_sum = 'sum(practical_fee) as practical_fee,sum(cash) as cash,sum(real_fee) as real_fee,sum(service_charge) as service_charge, $field_sum = 'sum(practical_fee) as practical_fee,sum(cash) as cash,sum(real_fee) as real_fee,sum(service_charge) as service_charge,
sum(charity_fund) as charity_fund'; sum(charity_fund) as charity_fund';
//应分佣金 //应分佣金
$partial_commission = $this->field($field_sum)->where('confirm_date', 'between time', [ $operation_start_data, $operation_end_data ]) $partial_commission = $this->field($field_sum)
->where('agent_id', $v['agent_id'])->find(); ->where('confirm_date', 'between time', [ $operation_start_data, $operation_end_data ])
->where('agent_id', $v['agent_id'])
->where('confirm_status', 1)
->where('is_del', 0)
->find();
$data[$k]['practical_fee'] = $partial_commission['practical_fee']; $data[$k]['practical_fee'] = $partial_commission['practical_fee'];
$data[$k]['cash'] = $partial_commission['cash']; $data[$k]['cash'] = $partial_commission['cash'];
......
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