Commit bf53bca6 authored by hujun's avatar hujun

Merge branch 'test-v1.9' of https://gitee.com/zwyjjc/tl_estate into test-v1.9

parents f73c9071 42fa6571
......@@ -198,6 +198,9 @@ class OrderLog extends Basic
/**
* 成交报告
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function bargain()
{
......@@ -518,8 +521,8 @@ class OrderLog extends Basic
$data['msg'] = "";
$data['data'] = [];
if (empty($this->params['id']) || empty($this->params['agent_id'])) {
return $this->response(101, 'Id or agent_id is null.');
if (empty($this->params['id']) || empty($this->params['agent_id']) || empty($this->params['source']) ) {
return $this->response(101, 'Id or agent_id or source is null.');
}
$bargain = new OBargainModel();
......@@ -538,12 +541,13 @@ class OrderLog extends Basic
$insert_data['price'] = $bargain_data['price'];
$insert_data['commission'] = $bargain_data['commission'];
$insert_data['status'] = $bargain_data['status'];
$insert_data['source'] = 1;
$insert_data['source'] = $bargain_data['source'];
$insert_data['role'] = empty($this->params['role']) ? 0 : $this->params['role'];
$insert_data['scale_fee'] = empty($this->params['scale_fee']) ? 0 : $this->params['scale_fee'];
$insert_data['practical_fee'] = empty($this->params['practical_fee']) ? 0 : $this->params['practical_fee'];
$insert_data['father_id'] = empty($this->params['id']) ? 0 : $this->params['id'];
$insert_data['father_id'] = $this->params['id'];
$insert_data['scale'] = empty($this->params['scale']) ? 0 : $this->params['scale'];
$insert_data['is_commission'] = 1;
$data['data']['id'] = $bargain->insertBargain($insert_data);
if ($data['data'] == 0) {
......
......@@ -117,7 +117,10 @@ class OrderLogService
* @param $price
* @param $commission
* @param $commission_arr
* @return int
* @return int|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function addBargain($submit_agent_id, $submit_agent_name, $report_id, $order_id, $order_no, $trade_type, $price, $commission, $commission_arr)
{
......@@ -763,6 +766,9 @@ class OrderLogService
* 获取成交报告列表
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getBargainList($params)
{
......@@ -780,7 +786,6 @@ class OrderLogService
$filed = "a.id,a.agent_id,a.create_time,b.user_phone,b.user_name,b.user_id,d.id as house_id,d.internal_title,d.internal_address";
$result = $bargainModel->selectBargainList($filed, $params, $pageNo, $pageSize);
foreach ($result as $k => $v) {
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$result[$k]["create_time"] = date("Y-m-d", strtotime($v["create_time"]));
}
return $result;
......@@ -800,8 +805,8 @@ class OrderLogService
{
$bargainModel = new OBargainModel();
$filed = "a.id,a.trade_type,a.price,a.submit_agent_id,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.status,
b.name,b.phone";
$filed = "a.id,a.trade_type,a.price,a.submit_agent_id,a.commission,a.role,
a.agent_id,a.scale,a.scale_fee,a.status,b.name,b.phone";
return $bargainModel->selectBargainDetail($filed, $params);
}
......@@ -809,6 +814,9 @@ class OrderLogService
/**
* 成交报告提交后用户状态从求租变成已租
* @param $report_id
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function userUpdateInfo($report_id)
{
......
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