Commit 50b475c7 authored by hujun's avatar hujun

office_bargain

parent c7c72da3
......@@ -459,9 +459,8 @@ class OfficeBargain extends Basic
} catch (\Exception $e) {
return $this->response(101, '内部错误,修改成交报告失败!请联系运营。');
}
$data['code'] = 200;
} else {
$data['code'] = 101;
$data['msg'] = 'Modify the failure.';
}
......
......@@ -19,6 +19,7 @@ use app\model\OfficeOImg;
use app\model\OfficeOPayLogAdjustment;
use app\model\OfficeOPayLogModel;
use app\model\OfficeOrderModel;
use app\model\OfficeORealIncome;
use app\model\OfficeORefundLogModel;
use app\model\OfficeORefundModel;
use app\model\OfficeOReportModel;
......@@ -1329,21 +1330,24 @@ class OfficePayLog extends Basic
public function bargainInfo()
{
$data['code'] = 200;
$data['msg'] = "";
$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 $data;
}
$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'];
$list = $this->m_bargain->getBargainInfo($fields, $where);
$m_fee = new OfficeORealIncome();
$list['practical_fee'] = $m_fee->getBargainTaxes($list['id']); //获取实收佣金
$list['bargain_id'] = $list["father_id"] == 0 ? $list["id"] : $list["father_id"];//成交报告ID
$data['data'] = $list;
return $this->response($data['code'], $data['msg'], $data['data']);
}
......
......@@ -468,7 +468,7 @@ class OfficeOBargainModel extends Model
*/
public function getBargainInfo($field, $params)
{
$data = $this->field($field)->alias('a')
return $this->field($field)->alias('a')
->join('office_o_report b', 'a.report_id = b.id', 'left')
->join('office_o_order c', 'a.order_id = c.id', 'left')
->join('office_g_room d', 'c.house_id = d.id', 'left')
......@@ -476,15 +476,6 @@ class OfficeOBargainModel extends Model
->join('o_partial_commission e', 'e.bargain_id = a.id', 'left')
->where($params)
->find();
if (isset($data['id'])) {
$m_fee = new ORealIncome();
$data['practical_fee'] = $m_fee->getBargainTaxes($data['id']); //获取实收佣金
} else {
$data = [];
}
return $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