Commit f7d6da66 authored by hujun's avatar hujun

成交报告搜索分佣方

parent 309fb6c1
......@@ -120,14 +120,18 @@ class Finance extends Basic
if (!empty($agent_where)) {
$m_agent = new AAgents();
$where_bargain_id = $m_agent->agentBargainAll('b.id', $agent_where);
$where_bargain_id = $m_agent->agentBargainAll('b.id,b.father_id', $agent_where);
if (empty($where_bargain_id)) {
return $this->response(200, '');
} else {
$where_id = [];
foreach ($where_bargain_id as $k => $v) {
$where_id[] = $v['id'];
if ($v['father_id'] == 0) {
$where_id[] = $v['id'];
} else {
$where_id[] = $v['father_id'];
}
}
$where['a.id'] = [ 'in', $where_id ];
}
......@@ -136,14 +140,18 @@ class Finance extends Basic
//分佣方姓名
if (!empty($this->params['partial_id'])) {
$m_agent = new AAgents();
$where_bargain_id = $m_agent->agentBargainAll('b.id', [ 'a.id' => $this->params['partial_id'] ]);
$where_bargain_id = $m_agent->agentBargainAll('b.id,b.father_id', [ 'a.id' => $this->params['partial_id'] ]);
if (empty($where_bargain_id)) {
return $this->response(200, '');
} else {
$where_id = [];
foreach ($where_bargain_id as $k => $v) {
$where_id[] = $v['id'];
if ($v['father_id'] == 0) {
$where_id[] = $v['id'];
} else {
$where_id[] = $v['father_id'];
}
}
$where['a.id'] = [ 'in', $where_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