Commit 48f0b235 authored by hujun's avatar hujun

获取成交报告分佣方佣金和修改

parent 75580f11
...@@ -1384,4 +1384,37 @@ class Finance extends Basic ...@@ -1384,4 +1384,37 @@ class Finance extends Basic
return $this->response($result['code'], $result['msg']); return $this->response($result['code'], $result['msg']);
} }
/**
* 成交报告分佣方详情
*
* @return type
*/
public function getBargainoCommission() {
if (empty($this->params['bargain_id'])) {
return $this->response(101, '成交报告id为空');
}
$m_bargain = new OBargainModel();
if ($this->request->isGet()) {
$field = 'a.id,a.scale,a.agent_id,a.role,a.scale_fee';
$data = $m_bargain->getBargainPartialDetail($field, ['id'=>$this->params['bargain_id']]);
return $this->response(200, '', $data);
}
if (empty($this->params['agent_id'])) {
return $this->response(101, '经纪人id为空');
}
if (empty($this->params['scale'])) {
return $this->response(101, '分佣比例为空');
}
$update['agent_id'] = $this->params['agent_id'];
$update['scale'] = $this->params['scale'];
$data = $m_bargain->updateBargainById($this->params['bargain_id'], $update);
return $this->response(200, '修改成功', $data);
}
} }
...@@ -278,6 +278,10 @@ class OBargainModel extends Model ...@@ -278,6 +278,10 @@ class OBargainModel extends Model
$whereOr_["a.father_id"] = $params["bargain_id"]; $whereOr_["a.father_id"] = $params["bargain_id"];
} }
if ($isset($params['id'])) {
$where_['a.id'] = $params['id'];
}
$result = $this->db_ $result = $this->db_
->field($filed) ->field($filed)
->alias("a") ->alias("a")
...@@ -1105,4 +1109,46 @@ class OBargainModel extends Model ...@@ -1105,4 +1109,46 @@ class OBargainModel extends Model
->where('a.id', $id) ->where('a.id', $id)
->find(); ->find();
} }
/**
* 成交报告分佣方详情
*
* @param type $param
* @return boolean
*/
public function getBargainPartialDetail($filed, $param) {
$where_ = $whereOr_ = [];
if (isset($param["bargain_id"])) {
$where_["a.id"] = $params["bargain_id"];
$whereOr_["a.father_id"] = $params["bargain_id"];
}
if (isset($param['id'])) {
$where_['a.id'] = $param['id'];
}
try {
$result = $this->db_
->field($filed)
->alias("a")
->join("o_partial_commission b", "a.id = b.bargain_id", "left")
->where($where_)
->whereOr($whereOr_)
->order("a.id asc")
->find();
$m_agent = new AAgents();
$filed_agent = 'a.id,a.name,a.phone,b.store_name,c.district_name';
$agent_info = $m_agent->getAgentsInfoByAgentId($filed_agent, ['agent_id'=> $result['agent_id']]);
$result['district_name'] = $agent_info[0]['district_name'];
$result['store_name'] = $agent_info[0]['store_name'];
$result['name'] = $agent_info[0]['name'];
$result['phone'] = $agent_info[0]['phone'];
} catch (\Exception $ex) {
$result = false;
}
return $result;
}
} }
\ No newline at end of file
...@@ -234,6 +234,7 @@ Route::group('index', [ ...@@ -234,6 +234,7 @@ Route::group('index', [
'checkOver' => [ 'index/Finance/checkOver', [ 'method' => 'POST' ] ], //财务结单 'checkOver' => [ 'index/Finance/checkOver', [ 'method' => 'POST' ] ], //财务结单
'delPartialCommission' => [ 'index/Finance/delPartialCommission', [ 'method' => 'POST' ] ], //删除分佣方 'delPartialCommission' => [ 'index/Finance/delPartialCommission', [ 'method' => 'POST' ] ], //删除分佣方
'delTaxes' => [ 'index/Finance/delTaxes', [ 'method' => 'POST' ] ], //删除开票税费 'delTaxes' => [ 'index/Finance/delTaxes', [ 'method' => 'POST' ] ], //删除开票税费
'getBargainoCommission' => [ 'index/Finance/getBargainoCommission', [ 'method' => 'GET|POST' ] ], //获取成交报告分佣方佣金和修改
'addReceiptImg' => [ 'index/Collection/addReceiptImg', [ 'method' => 'post|get' ] ],//收款图片信息保存 'addReceiptImg' => [ 'index/Collection/addReceiptImg', [ 'method' => 'post|get' ] ],//收款图片信息保存
'deleteReceiptImg' => [ 'index/Collection/deleteReceiptImg', [ 'method' => 'post|get' ] ],//删除收款图片 'deleteReceiptImg' => [ 'index/Collection/deleteReceiptImg', [ 'method' => 'post|get' ] ],//删除收款图片
'receiptImgList' => [ 'index/Collection/receiptImgList', [ 'method' => 'post|get' ] ],//收款列表-收款图片列表 'receiptImgList' => [ 'index/Collection/receiptImgList', [ 'method' => 'post|get' ] ],//收款列表-收款图片列表
......
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