Commit a78bc87b authored by hujun's avatar hujun

成交报告详情

parent 7ed371a0
...@@ -1310,4 +1310,33 @@ class OfficePayLog extends Basic ...@@ -1310,4 +1310,33 @@ class OfficePayLog extends Basic
return $this->response($code, $msg); return $this->response($code, $msg);
} }
/**
* 通过id获取成交报告详情
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function bargainInfo()
{
$data['code'] = 200;
$data['msg'] = "";
$data['data'] = [];
if (empty($this->params['id'])) {
$data['code'] = 101;
$data['msg'] = 'Id is null.';
} else {
$fields = 'a.id,a.father_id,a.create_time,b.user_phone,b.user_name,f.title as internal_title,f.address as internal_address,a.is_open,a.order_id,a.report_id,';
$fields .= 'a.trade_type,a.house_number,a.commission,a.content,f.type,a.industry_type,a.price,a.estimated_receipt_date,';
$fields .= 'b.user_id,d.id as house_id';
$where['a.id'] = $this->params['id'];
$data['data'] = $this->m_bargain->getBargainInfo($fields, $where);
$data['data']['bargain_id'] = $data['data']["father_id"] == 0 ? $data['data']["id"] : $data['data']["father_id"];//成交报告ID
}
return $this->response($data['code'], $data['msg'], $data['data']);
}
} }
\ No newline at end of file
...@@ -471,7 +471,8 @@ class OfficeOBargainModel extends Model ...@@ -471,7 +471,8 @@ class OfficeOBargainModel extends Model
$data = $this->field($field)->alias('a') $data = $this->field($field)->alias('a')
->join('o_report b', 'a.report_id = b.id', 'left') ->join('o_report b', 'a.report_id = b.id', 'left')
->join('o_order c', 'a.order_id = c.id', 'left') ->join('o_order c', 'a.order_id = c.id', 'left')
->join('g_houses d', 'c.house_id = d.id', 'left') ->join('office_g_room d', 'c.house_id = d.id', 'left')
->join('office_g_room f', 'd.building_id = f.id', 'left')
->join('o_partial_commission e', 'e.bargain_id = a.id', 'left') ->join('o_partial_commission e', 'e.bargain_id = a.id', 'left')
->where($params) ->where($params)
->find(); ->find();
......
...@@ -1050,6 +1050,7 @@ Route::group('office_index', [ ...@@ -1050,6 +1050,7 @@ Route::group('office_index', [
'refundPayLog' => ['index/officePayLog/refundPayLog', ['method' => 'POST']],//退款 'refundPayLog' => ['index/officePayLog/refundPayLog', ['method' => 'POST']],//退款
'delPayLog' => ['index/officePayLog/delPayLog', ['method' => 'POST']],//删除收款 'delPayLog' => ['index/officePayLog/delPayLog', ['method' => 'POST']],//删除收款
'delAdjustment' => ['index/officePayLog/delAdjustment', ['method' => 'post']],//撤销调整 'delAdjustment' => ['index/officePayLog/delAdjustment', ['method' => 'post']],//撤销调整
'bargainInfo' => ['index/officePayLog/bargainInfo', ['method' => 'post']],//成交报告详情
]); ]);
......
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