Commit c66ae66b authored by hujun's avatar hujun

成交报告修改-撤销修改

parent a746bb44
...@@ -1364,9 +1364,8 @@ class Finance extends Basic ...@@ -1364,9 +1364,8 @@ 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)
{ {
$m_bargain = new OBargainModel(); $m_bargain = new OBargainModel();
$house_number_table = $m_bargain->getCheckBargain('a.house_number,c.internal_address', (int)$bargain_id); $house_number_table = $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']}]"; $step_content .= "[{$house_number_table['internal_address']}]";
if (empty($house_number)) { if (empty($house_number)) {
...@@ -1542,7 +1541,22 @@ class Finance extends Basic ...@@ -1542,7 +1541,22 @@ class Finance extends Basic
$code = 200; $code = 200;
$this->editRecordLog($this->params['bargain_id'], '[撤销成交报告]', 3); //日志记录 $this->editRecordLog($this->params['bargain_id'], '[撤销成交报告]', 3); //日志记录
$this->updatePerformance($this->params['bargain_id']); $this->updatePerformance($this->params['bargain_id']);
$bargain = new OBargainModel();
$bargain_data = $bargain->getBargainDetail('order_id,order_no,agent_id', ['id'=>$this->params['bargain_id']]);
$financial_data['bargain_id'] = $this->params['bargain_id'];
$financial_data['audit_name'] = $this->userName;
$financial_data['audit_id'] = $this->userId;
$financial_data['agent_id'] = $bargain_data[0]['agent_id'];
$financial_data['order_no'] = $bargain_data[0]['order_no'];
$financial_data['order_id'] = $bargain_data[0]['order_id'];
$financial_data['status'] = 0;
$financial_data['source'] = 3;
$financial_data['order_no'] = 0;
$financial_data['audit_level'] = 0;
$financial_data['remark'] = $this->params['remark'];
$financial_data['audit_id'] = $this->userId;
$m_financial->addAudit($financial_data);
$msg = '撤销成功'; $msg = '撤销成功';
} else { } else {
$code = 101; $code = 101;
......
...@@ -426,7 +426,7 @@ class OBargainModel extends Model ...@@ -426,7 +426,7 @@ class OBargainModel extends Model
//是否有审核记录,只做一次审核。 //是否有审核记录,只做一次审核。
if (isset($audit_data['id'])) { if (isset($audit_data['id'])) {
if ($source == 3 && $status == 20) { if ($source == 3 && $data['audit_level'] == 3) {
$save_data['status'] = 4; $save_data['status'] = 4;
} }
...@@ -1198,19 +1198,20 @@ class OBargainModel extends Model ...@@ -1198,19 +1198,20 @@ class OBargainModel extends Model
/** /**
* 获取正常成交报告 * 获取正常成交报告
* *
* @param $field * @param string $field
* @param $id * @param int $id
* @param string $status
* @return array|false|\PDOStatement|string|Model * @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getCheckBargain(string $field, int $id) public function getCheckBargain(string $field, int $id, $status = '10,11')
{ {
return $this->field($field)->alias('a') return $this->field($field)->alias('a')
->join('o_order b', 'a.order_id=b.id', 'left') ->join('o_order b', 'a.order_id=b.id', 'left')
->join('g_houses c', 'b.house_id=c.id', 'left') ->join('g_houses c', 'b.house_id=c.id', 'left')
->where('a.status', 'in', '10,11') ->where('a.status', 'in', $status)
->where('a.id', $id) ->where('a.id', $id)
->find(); ->find();
} }
......
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