Commit 055f9c50 authored by hujun's avatar hujun

收款列表

parent cc35a0f8
...@@ -2695,6 +2695,37 @@ class Finance extends Basic ...@@ -2695,6 +2695,37 @@ class Finance extends Basic
} }
} }
public function getCollectionDetail() {
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_data = $m_pay->selectReceiptImgList($pay_fields, ['id'=>$this->params['pay_id']]);
$pay_data[0]['transfer_name'] = empty($pay_data[0]['transfer_name'])? "":$pay_data[0]['transfer_name'];
//成交报告id
if (empty($pay_data[0]['order_id'])) {
$pay_data[0]['bargain_id'] = 0;
} else {
$bargain_id = $this->m_bargain->getDetail('id,price,is_open', ['order_id'=>$pay_data[0]['order_id']]);
$pay_data[0]['bargain_id'] = empty($bargain_id) ? "":$bargain_id;
}
$m_pay_adjustment = new OPayLogAdjustment();
$source_id = $m_pay_adjustment->getFieldValue('id', ['paylog_id'=> $pay_data[0]['id']]);
$pay_data[0]['source_id'] = empty($source_id) ? 0 : $source_id;
} catch (\Exception $e) {
$msg = '内部错误:'.$e->getMessage();
}
return $this->response(101, $msg, $pay_data[0]);
}
/** /**
* 获取收款入账 * 获取收款入账
* *
......
...@@ -1572,4 +1572,18 @@ class OBargainModel extends Model ...@@ -1572,4 +1572,18 @@ class OBargainModel extends Model
public function getFieldValue($field, $where) { public function getFieldValue($field, $where) {
return $this->where($where)->value($field); return $this->where($where)->value($field);
} }
/**
* @param $field
* @param $where
* @return array|false|\PDOStatement|string|Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getDetail($field, $where) {
return $this->field($field)
->where($where)
->find();
}
} }
\ No newline at end of file
...@@ -382,7 +382,7 @@ class OPayLogModel extends Model ...@@ -382,7 +382,7 @@ class OPayLogModel extends Model
->join("o_order b", "a.order_id = b.id", "left") ->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left") // ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'c.report_agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left') // ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left') // ->join('a_district g', 'f.district_id=g.id', 'left')
->where($params) ->where($params)
...@@ -392,7 +392,7 @@ class OPayLogModel extends Model ...@@ -392,7 +392,7 @@ class OPayLogModel extends Model
->join("o_order b", "a.order_id = b.id", "left") ->join("o_order b", "a.order_id = b.id", "left")
// ->join("o_report c", "b.f_id = c.id", "left") // ->join("o_report c", "b.f_id = c.id", "left")
->join('g_houses d', 'b.house_id = d.id', 'left') ->join('g_houses d', 'b.house_id = d.id', 'left')
->join('a_agents e', 'c.report_agent_id=e.id', 'left') ->join('a_agents e', 'a.agent_id=e.id', 'left')
// ->join('a_store f', 'e.store_id=f.id', 'left') // ->join('a_store f', 'e.store_id=f.id', 'left')
// ->join('a_district g', 'f.district_id=g.id', 'left') // ->join('a_district g', 'f.district_id=g.id', 'left')
->where($params) ->where($params)
......
...@@ -273,6 +273,7 @@ Route::group('index', [ ...@@ -273,6 +273,7 @@ Route::group('index', [
'addReceiptImg' => ['index/Finance/addReceiptImg', ['method' => 'post|get']],//收款图片信息保存 'addReceiptImg' => ['index/Finance/addReceiptImg', ['method' => 'post|get']],//收款图片信息保存
'deleteReceiptImg' => ['index/Finance/deleteReceiptImg', ['method' => 'post|get']],//删除收款图片 'deleteReceiptImg' => ['index/Finance/deleteReceiptImg', ['method' => 'post|get']],//删除收款图片
'receiptImgList' => ['index/Finance/receiptImgList', ['method' => 'post|get']],//收款列表-收款图片列表 'receiptImgList' => ['index/Finance/receiptImgList', ['method' => 'post|get']],//收款列表-收款图片列表
'getCollectionDetail' => ['index/Finance/getCollectionDetail', ['method' => 'post|get']],//收款详情
'performanceInfo' => ['index/PerformanceInfo/performanceInfo', ['method' => 'post|get']],//业绩明细 'performanceInfo' => ['index/PerformanceInfo/performanceInfo', ['method' => 'post|get']],//业绩明细
'getPerformanceInfoExcel' => ['index/PerformanceInfo/getPerformanceInfoExcel', ['method' => 'post|get']],//业绩明细 'getPerformanceInfoExcel' => ['index/PerformanceInfo/getPerformanceInfoExcel', ['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