Commit 693e7421 authored by hujun's avatar hujun

成交报告ID

parent 63689ffd
...@@ -1353,7 +1353,8 @@ class Finance extends Basic ...@@ -1353,7 +1353,8 @@ class Finance extends Basic
$where['e.id'] = $this->params['partial_id']; $where['e.id'] = $this->params['partial_id'];
} }
$field = 'a.id,a.confirm_date,a.practical_fee,b.scale_fee,b.scale,b.role,d.internal_address,b.agent_id,cash,service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission,d.internal_address'; $field = 'a.id,a.confirm_date,a.practical_fee,b.scale_fee,b.scale,b.role,d.internal_address,b.agent_id,cash,';
$field .= 'service_charge,charity_fund,real_fee,a.real_income_id,a.should_commission,d.internal_address,b.father_id,b.id as bargain_id';
$m_commission = new OPartialCommission(); $m_commission = new OPartialCommission();
try { try {
...@@ -1364,6 +1365,11 @@ class Finance extends Basic ...@@ -1364,6 +1365,11 @@ class Finance extends Basic
$fields_str = 'a.id,a.name,a.phone,b.store_name,c.district_name'; $fields_str = 'a.id,a.name,a.phone,b.store_name,c.district_name';
$result = []; $result = [];
foreach ($data as $k => $v) { foreach ($data as $k => $v) {
if ($v['father_id'] >0 ) {
$result[$k]['bargain_id'] = $v['father_id'];
} else {
$result[$k]['bargain_id'] = $v['bargain_id'];
}
$result[$k]['income_time'] = $m_real->where('id', $v['real_income_id'])->value('income_time'); $result[$k]['income_time'] = $m_real->where('id', $v['real_income_id'])->value('income_time');
if ($v['agent_id']) { if ($v['agent_id']) {
$agent_data = $m_agent->getStoreDistrict($fields_str, [ 'a.id' => $v['agent_id'] ]); $agent_data = $m_agent->getStoreDistrict($fields_str, [ 'a.id' => $v['agent_id'] ]);
...@@ -1409,8 +1415,8 @@ class Finance extends Basic ...@@ -1409,8 +1415,8 @@ class Finance extends Basic
return '<script>alert("导出分佣提成明细列表失败");window.close();</script>'; return '<script>alert("导出分佣提成明细列表失败");window.close();</script>';
} }
$export = new ExportExcelUntil(); $export = new ExportExcelUntil();
$title = [ '收佣日期', '所属部门/门店', '业务员','商铺地址','分佣角色', '分佣比例(%)','应分佣金(元)', '预分佣金(元)', '手续费(元)', '慈善基金(元)', '现金奖(元)', '实收佣金(元)' ]; $title = [ '成交报告ID','收佣日期', '所属部门/门店', '业务员','商铺地址','分佣角色', '分佣比例(%)','应分佣金(元)', '预分佣金(元)', '手续费(元)', '慈善基金(元)', '现金奖(元)', '实收佣金(元)' ];
$export->exportTable('实收明细表', $result, 11, '实收明细表', $title); $export->exportTable('实收明细表', $result, 12, '实收明细表', $title);
return ''; return '';
} }
......
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