Commit 8a867533 authored by hujun's avatar hujun

del

parent 4a2631ed
...@@ -3558,103 +3558,6 @@ class Finance extends Basic ...@@ -3558,103 +3558,6 @@ class Finance extends Basic
*/ */
public function getCollectionDetail() { public function getCollectionDetail() {
if (empty($this->params['pay_id'])) { if (empty($this->params['pay_id'])) {
return $this->response(101, '参数错误');
}
$msg = "";
$pay_data = [];
try {
$m_pay = new OPayLogModel();
$pay_fields = 'id,order_id,agent_name,create_time,income_time,house_number,type,real_money,income_time,transfer_name,';
$pay_fields .= 'transaction_fee,is_dividend,receipt_number,source,pay_type,last_transfer_time,money,industry_type,received_money,type_ext';
$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;
$pay_data['price'] = 0;
} else {
$bargain_data = $this->m_bargain->getDetail('id,father_id,price,is_open', ['order_id'=>$pay_data['order_id']]);
$bargain_id = $bargain_data['id'];
if ($bargain_data['father_id'] != 0) {
$bargain_id = $bargain_data['father_id'];
}
$pay_data['bargain_id'] = empty($bargain_id)? '':$bargain_id;
$pay_data['is_open'] = empty($bargain_data['is_open']) ? 0 :$bargain_data['is_open'];
$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,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'];
}
$m_pay_adjustment = new OPayLogAdjustment();
$source_id = $m_pay_adjustment->getFieldColumn('id', ['paylog_id'=> $pay_data['id']]);
$pay_data['source_id'] = empty($source_id) ? 0 : implode(',', $source_id);
$m_refund = new ORefundModel();
$num = $m_refund->getFind('id',['pay_log_id'=>$pay_data['id'],'is_del'=>0]);
if ($num['id'] > 0) {
$pay_data['is_refund'] = 1;
} else {
$pay_data['is_refund'] = 0;
}
$m_agent_house = new GHousesToAgents();
$m_store = new AStore();
$m_report = new OReportModel();
$pay_data['current_agent_name'] = $pay_data['store_name'] = "";
if ($pay_data['type'] == 92) {
//案场费 对应业务员:盘方
$m_house = new GHouses();
$is_exclusive_type = $m_house->getHouseValue('is_exclusive_type', ['id'=>$pay_data['house_id']]);
//案场费 对应业务员:盘方
$current_where['a.is_del'] = 0;
if ($is_exclusive_type) {
$current_where['a.type'] = 3;
} else {
$current_where['a.type'] = 2;
}
$current_agent_name = $m_agent_house->getHousesAgents($pay_data['house_id'], 'b.name,b.store_id', $current_where);
$pay_data['current_agent_name'] = empty($current_agent_name[0]['name']) ? '':$current_agent_name[0]['name'];
$store_name = $m_store->getStoreKeyById('store_name', ['id'=>$current_agent_name[0]['store_id']]);
$pay_data['store_name'] = empty($store_name)? '' : $store_name;
}
if ($pay_data['type'] == 10 || $pay_data['type'] == 30 || $pay_data['type'] == 91) {
//意向金/保管金 10/30 对应业务员:约带看的人 即 反签方
//中介费 对应业务员:约带看的人 即 反签方
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[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(200, $msg, $pay_data);
}
/**
* 收款详情
*
* @return \think\Response
*/
public function getCollectionDetailV2() {
if (empty($this->params['pay_id'])) {
// return $this->response(101, '参数错误'); // return $this->response(101, '参数错误');
} }
......
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