Commit b41893cc authored by hujun's avatar hujun

收款详情

parent 734dfb9b
......@@ -26,6 +26,7 @@ use app\model\OMarchInModel;
use app\model\OPayLogAdjustment;
use app\model\OrderModel;
use app\model\ORealIncome;
use app\model\OReportModel;
use app\model\OTaxes;
use app\model\OFinancialAudit;
use app\model\OPartialCommission;
......@@ -2416,14 +2417,14 @@ class Finance extends Basic
}
if (empty($this->params['excel'])) {
$field = 'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,a.transaction_fee,a.source,';
$field = 'a.id,a.create_time,a.order_id,a.father_id,a.money,a.real_money,a.pay_type,a.type,a.source,a.transaction_fee,a.source,b.f_id,';
$field .= 'e.name,a.income_time,e.store_id,b.house_id,b.order_no,a.report_id,a.house_number,a.is_dividend,a.last_transfer_time,a.industry_type,a.agent_id';
$list = $order->getAddPayLogOrderListLimit($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
$data['total'] = $order->getAddPayLogOrderListLimitTotal($where);
$m_store = new AStore();
$m_pay_adjustment = new OPayLogAdjustment();
$m_march = new OMarchInModel();
$m_report = new OReportModel();
$m_agent_house = new GHousesToAgents();
$m_agent = new AAgents();
foreach ($list as $k=>$v) {
......@@ -2444,12 +2445,12 @@ class Finance extends Basic
if ($v['type'] == 10 || $v['type'] == 30 || $v['type'] == 91) {
//意向金/保管金 10/30 对应业务员:约带看的人 即 反签方
//中介费 对应业务员:约带看的人 即 反签方
$current_agent_name = $m_march->getInfo('reception_name,reception_id', ['order_id'=>$v['order_id']]);
if (!empty($current_agent_name['reception_id'])) {
$store_name = $m_agent->getAgentByIdV2('b.store_name', ['a.id'=>$current_agent_name['reception_id']]);
$current_agent_name = $m_report->selectReportById('report_agent_name,report_store_id', ['id'=>$v['f_id']]);
if (!empty($current_agent_name[0]['report_store_id'])) {
$store_name = $m_store->getStoreKeyById('store_name', ['id'=>$current_agent_name[0]['report_store_id']]);
$list[$k]['store_name'] = empty($store_name)? '' : $store_name;
}
$list[$k]['current_agent_name'] = empty($current_agent_name['reception_name']) ? '' : $current_agent_name['reception_name'];
$list[$k]['current_agent_name'] = empty($current_agent_name[0]['report_agent_name']) ? '' : $current_agent_name[0]['report_agent_name'];
}
if (!empty($v['income_time'])) {
......@@ -2734,6 +2735,7 @@ class Finance extends Basic
$pay_data = $m_pay->selectReceiptImgList($pay_fields, ['id'=>$this->params['pay_id']]);
$pay_data = $pay_data[0];
//成交报告id
if (empty($pay_data['order_id'])) {
$pay_data['bargain_id'] = "";
$pay_data['is_open'] = 0;
......@@ -2745,7 +2747,8 @@ class Finance extends Basic
$pay_data['price'] = empty($bargain_data['price'])? 0:$bargain_data['price'];
$m_order = new OrderModel();
$house_data = $m_order->selectOrderByOrderId('b.id,b.internal_address', ['order_id'=>$pay_data['order_id']]);
$house_data = $m_order->selectOrderByOrderId('b.id,b.internal_address,a.f_id', ['order_id'=>$pay_data['order_id']]);
$pay_data['house_id'] = empty($house_data[0]['id']) ? '':$house_data[0]['id'];
$pay_data['address'] = empty($house_data[0]['internal_address']) ? '':$house_data[0]['internal_address'];
}
......@@ -2757,7 +2760,7 @@ class Finance extends Basic
$m_agent = new AAgents();
$m_agent_house = new GHousesToAgents();
$m_store = new AStore();
$m_march = new OMarchInModel();
$m_report = new OReportModel();
$pay_data['current_agent_name'] = $pay_data['store_name'] = "";
if ($pay_data['type'] == 92) {
//案场费 对应业务员:盘方
......@@ -2769,16 +2772,23 @@ class Finance extends Basic
if ($pay_data['type'] == 10 || $pay_data['type'] == 30 || $pay_data['type'] == 91) {
//意向金/保管金 10/30 对应业务员:约带看的人 即 反签方
//中介费 对应业务员:约带看的人 即 反签方
$current_agent_name = $m_march->getInfo('reception_name,reception_id', ['order_id'=>$pay_data['order_id']]);
if (!empty($current_agent_name['reception_id'])) {
$pay_data['store_name'] = $m_agent->getAgentByIdV2('b.store_name', ['a.id'=>$current_agent_name['reception_id']]);
if (isset($house_data[0]['f_id'])) {
$current_agent_name = $m_report->selectReportById('report_agent_name,report_store_id', ['id'=>$house_data[0]['f_id']]);
if (!empty($current_agent_name[0]['report_store_id'])) {
$pay_data['store_name'] = $m_store->getStoreKeyById('store_name', ['id'=>$current_agent_name[0]['report_store_id']]);
}
$pay_data['current_agent_name'] = empty($current_agent_name['reception_name']) ? "" : $current_agent_name['reception_name'];
$pay_data['current_agent_name'] = empty($current_agent_name[0]['report_agent_name']) ? "" : $current_agent_name[0]['report_agent_name'];
} else {
$pay_data['store_name'] = '';
$pay_data['current_agent_name'] = '';
}
}
} catch (\Exception $e) {
$msg = '内部错误:'.$e->getMessage();
}
return $this->response(101, $msg, $pay_data);
return $this->response(200, $msg, $pay_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