Commit ad4ecda4 authored by hujun's avatar hujun

约带看

parent 1fd91a2d
...@@ -244,7 +244,7 @@ class Finance extends Basic ...@@ -244,7 +244,7 @@ class Finance extends Basic
} }
if (!empty($agent_where)) { if (!empty($agent_where)) {
$m_agent = new OMarchInModel(); $m_agent = new OReportModel();
$agent_where['c.id'] = ['>', 0]; $agent_where['c.id'] = ['>', 0];
$march_bargain_id = $m_agent->getAgentMarchIn('c.id,c.father_id', $agent_where); $march_bargain_id = $m_agent->getAgentMarchIn('c.id,c.father_id', $agent_where);
......
...@@ -222,9 +222,9 @@ class OfficeBargain extends Basic ...@@ -222,9 +222,9 @@ class OfficeBargain extends Basic
} }
if (!empty($agent_where)) { if (!empty($agent_where)) {
$m_agent_march = new OfficeOMarchInModel(); $m_agent = new OfficeOReportModel();
$agent_where['c.id'] = ['>', 0]; $agent_where['c.id'] = ['>', 0];
$march_bargain_id = $m_agent_march->getAgentMarchIn('c.id,c.father_id', $agent_where); $march_bargain_id = $m_agent->getAgentMarchIn('c.id,c.father_id', $agent_where);
if ($march_bargain_id['status'] == 'fail') { if ($march_bargain_id['status'] == 'fail') {
return $this->response(101, '约带查询错误:'.$march_bargain_id['msg']); return $this->response(101, '约带查询错误:'.$march_bargain_id['msg']);
......
...@@ -1137,6 +1137,31 @@ class OReportModel extends Model ...@@ -1137,6 +1137,31 @@ class OReportModel extends Model
->where($params) ->where($params)
->select(); ->select();
} }
/**
* 带看经纪人
*
* @param $field
* @param $where
* @return mixed
*/
public function getAgentMarchIn($field, $where) {
try {
$data['data'] = $this->db->field($field)
->alias('a')
->join('a_agents b', 'a.report_agent_id = b.id', 'left')
->join('o_order d', 'a.id = d.f_id', 'left')
->join('o_bargain c', 'd.id = c.order_id', 'left')
->where($where)
->select();
$data['status'] = 'successful';
} catch (\Exception $e) {
$data['status'] = 'fail';
$data['msg'] = $e->getMessage();
}
return $data;
}
} }
......
...@@ -851,6 +851,31 @@ class OfficeOReportModel extends Model ...@@ -851,6 +851,31 @@ class OfficeOReportModel extends Model
//echo Db::table($this->table)->getLastSql(); //echo Db::table($this->table)->getLastSql();
return $result; return $result;
} }
/**
* 带看经纪人
*
* @param $field
* @param $where
* @return mixed
*/
public function getAgentMarchIn($field, $where) {
try {
$data['data'] = $this->db->field($field)
->alias('a')
->join('a_agents b', 'a.report_agent_id = b.id', 'left')
->join('office_o_order d', 'a.id = d.f_id', 'left')
->join('office_o_bargain c', 'd.id = c.order_id', 'left')
->where($where)
->select();
$data['status'] = 'successful';
} catch (\Exception $e) {
$data['status'] = 'fail';
$data['msg'] = $e->getMessage();
}
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