Commit a83171d9 authored by hujun's avatar hujun

修改分佣方优化日志内容显示

parent a88baa33
...@@ -1750,7 +1750,10 @@ class Finance extends Basic ...@@ -1750,7 +1750,10 @@ class Finance extends Basic
public function editRecordLog(int $bargain_id, string $step_content = '', int $type = 1, string $house_number = '', int $is_open = 0) public function editRecordLog(int $bargain_id, string $step_content = '', int $type = 1, string $house_number = '', int $is_open = 0)
{ {
$house_number_table = $this->m_bargain->getCheckBargain('a.house_number,c.internal_address', (int)$bargain_id, '10,11,12,13,20,21,30'); $house_number_table = $this->m_bargain->getCheckBargain('a.house_number,c.internal_address', (int)$bargain_id, '10,11,12,13,20,21,30');
$step_content .= "[{$house_number_table['internal_address']}]";
if (!empty($house_number_table['internal_address'])) {
$step_content .= "[{$house_number_table['internal_address']}]";
}
if (empty($house_number)) { if (empty($house_number)) {
$house_number = $house_number_table['house_number']; $house_number = $house_number_table['house_number'];
...@@ -1845,7 +1848,7 @@ class Finance extends Basic ...@@ -1845,7 +1848,7 @@ class Finance extends Basic
if (empty($this->params['bargain_id'])) { if (empty($this->params['bargain_id'])) {
return $this->response(101, '成交报告id为空'); return $this->response(101, '成交报告id为空');
} }
$field = 'a.id,a.scale,a.agent_id,a.role,a.scale_fee,b.scale as new_scale,b.should_commission,a.create_time'; $field = 'a.id,a.scale,a.agent_id,a.role,a.scale_fee,b.scale as new_scale,b.should_commission,a.create_time,a.father_id';
if ($this->request->isGet()) { if ($this->request->isGet()) {
$data = $this->m_bargain->getBargainPartialDetail($field, [ 'id' => $this->params['bargain_id'] ]); $data = $this->m_bargain->getBargainPartialDetail($field, [ 'id' => $this->params['bargain_id'] ]);
return $this->response(200, '', $data); return $this->response(200, '', $data);
...@@ -1881,22 +1884,32 @@ class Finance extends Basic ...@@ -1881,22 +1884,32 @@ class Finance extends Basic
$this->updatePerformance(0, $data_arr['agent_id']); $this->updatePerformance(0, $data_arr['agent_id']);
/*记录日志 start*/ /*记录日志 start*/
$bargain_data = $this->m_bargain->selectBargainByOrderNo('agent_id,father_id', [ 'id' => $this->params['bargain_id'] ]);
$father_id = $this->params['bargain_id']; $father_id = $this->params['bargain_id'];
if ($bargain_data[0]['father_id'] != 0) { if ($data_arr['father_id'] == 0) {
$father_id = $bargain_data[0]['father_id']; $father_id = $data_arr['father_id'];
} }
$agent_id[0] = $bargain_data[0]['agent_id']; $content = '';
$agent_id[1] = $this->params['agent_id']; if ($data_arr['agent_id'] != $this->params['agent_id']) {
$agent_id[0] = $data_arr['agent_id'];
$agent_id[1] = $this->params['agent_id'];
$m_agent = new AAgents();
$agent_data = $m_agent->getAgentById('id,name,phone', [ 'in_id' => $agent_id ]);
$content .= '【分佣方:' . $agent_data[0]['name'] . '-' . $agent_data[0]['phone']
. '修改为:' . $agent_data[1]['name'] . '-' . $agent_data[1]['phone'] . '】';
}
$m_agent = new AAgents(); if ($this->params['scale'] != $data_arr['scale']) {
$agent_data = $m_agent->getAgentById('id,name,phone', [ 'in_id' => $agent_id ]); $content .= '【分佣比例修改为:'.$this->params['scale'].'】';
}
$content = '修改成交报告【编号:' . $father_id . '】【分佣方:' . $agent_data[0]['name'] . '-' . $agent_data[0]['phone'] if ($this->params['scale_fee'] != $data_arr['scale_fee']) {
. '修改为:' . $agent_data[1]['name'] . '-' . $agent_data[1]['phone'] . '】'; $content .= '【应分佣金修改为:'.$this->params['scale_fee'].'】';
}
$this->editRecordLog($this->params['bargain_id'], $content); if (!empty($content)) {
$this->editRecordLog($father_id, '【编号:' . $father_id . '】'.$content);
}
/*记录日志 end*/ /*记录日志 end*/
return $this->response(200, '修改成功', $data); return $this->response(200, '修改成功', $data);
} }
......
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