Commit 0cb44bc6 authored by hujun's avatar hujun

office

parent 78ddd270
...@@ -4,6 +4,11 @@ namespace app\api_broker\controller; ...@@ -4,6 +4,11 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\api_broker\service\OfficePayLogService; use app\api_broker\service\OfficePayLogService;
use app\model\OfficeOImg;
use app\model\OfficeOPayLogModel;
use app\model\OfficeOrderModel;
use app\model\OfficeORefundLogModel;
use app\model\OfficeORefundModel;
use think\Request; use think\Request;
/** /**
...@@ -164,4 +169,47 @@ class OfficePayLog extends Basic ...@@ -164,4 +169,47 @@ class OfficePayLog extends Basic
return $this->response("101",$result["msg"]); return $this->response("101",$result["msg"]);
} }
} }
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function myRefundList()
{
$page_no = empty($this->params["page_no"]) ? 1 : $this->params["page_no"];
$page_size = empty($this->params["page_size"]) ? 2 : $this->params["page_size"];
// if (empty($this->params['agent_id']))) {
// return $this->response(101, '参数错误');
// }
// $where['agent_id'] = $this->params['agent_id'];
$field = 'id,create_time,agent_name,refund_money,order_id,pay_log_id,bank,card_no,name,remark';
$where['is_del'] = 0;
$m_refund = new OfficeORefundModel();
$m_pay = new OFficeOPayLogModel();
$m_order = new OfficeOrderModel();
$m_check_log = new OfficeORefundLogModel();
$m_img = new OfficeOImg();
$refund_data = $m_refund->getList($page_no, $page_size, 'ID DESC', $field, $where);
foreach ($refund_data as $k => $v) {
$refund_data[$k]['pay_create_time'] = $m_pay->getFieldValue('create_time', ['id' => $v['pay_log_id']]);
$house_data = $m_order->getHouseInfoByOrderIdOne('a.house_id,b.internal_address', ['a.id' => $v['order_id']]);
if ($house_data) {
$refund_data[$k]['house_id'] = $house_data['house_id'];
$refund_data[$k]['house_address'] = $house_data['internal_address'];
} else {
$refund_data[$k]['house_id'] = 0;
$refund_data[$k]['house_address'] = '';
}
$refund_data[$k]['image_array'] = $m_img->getImgList(['img_id' => $v['id'], 'img_type' => 3]);
$refund_data[$k]['check_log'] = $m_check_log->getListAll('create_time,operation_name', ['refund_id' => $v['id'], 'is_del' => 0]);
$refund_data[$k]['file_path'] = 'static/chat_image/';
}
return $this->response("101", $refund_data);
}
} }
\ No newline at end of file
...@@ -196,21 +196,12 @@ class PayLog extends Basic ...@@ -196,21 +196,12 @@ class PayLog extends Basic
$field = 'id,create_time,agent_name,refund_money,order_id,pay_log_id,bank,card_no,name,remark'; $field = 'id,create_time,agent_name,refund_money,order_id,pay_log_id,bank,card_no,name,remark';
$where['is_del'] = 0; $where['is_del'] = 0;
if ($this->params['refund_type'] == 1) { $m_refund = new OfficeORefundModel();
$m_refund = new ORefundModel(); $m_pay = new OFficeOPayLogModel();
$m_pay = new OPayLogModel(); $m_order = new OfficeOrderModel();
$m_order = new OrderModel(); $m_check_log = new OfficeORefundLogModel();
$m_check_log = new ORefundLogModel(); $m_img = new OfficeOImg();
$m_img = new OImg(); $refund_data = $m_refund->getList($page_no, $page_size, 'ID DESC', $field, $where);
$refund_data = $m_refund->getList($page_no, $page_size, 'ID DESC', $field, $where);
} else {
$m_refund = new OfficeORefundModel();
$m_pay = new OFficeOPayLogModel();
$m_order = new OfficeOrderModel();
$m_check_log = new OfficeORefundLogModel();
$m_img = new OfficeOImg();
$refund_data = $m_refund->getList($page_no, $page_size, 'ID DESC', $field, $where);
}
foreach ($refund_data as $k => $v) { foreach ($refund_data as $k => $v) {
$refund_data[$k]['pay_create_time'] = $m_pay->getFieldValue('create_time', ['id' => $v['pay_log_id']]); $refund_data[$k]['pay_create_time'] = $m_pay->getFieldValue('create_time', ['id' => $v['pay_log_id']]);
...@@ -229,7 +220,8 @@ class PayLog extends Basic ...@@ -229,7 +220,8 @@ class PayLog extends Basic
} }
return $this->response("101", $refund_data); return $this->response("101", $refund_data);
} }
/**我的收款记录列表
/**我的收款记录列表
* @return \think\Response * @return \think\Response
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
...@@ -238,26 +230,26 @@ class PayLog extends Basic ...@@ -238,26 +230,26 @@ class PayLog extends Basic
public function getPayLogList() public function getPayLogList()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"agent_id" => 1, "agent_id" => 1,
"search_type" => 1,//1商铺编号,2商铺地址 3收款id,4带看id "search_type" => 1,//1商铺编号,2商铺地址 3收款id,4带看id
"keyword" => "121", "keyword" => "121",
"submit_time_start" => '123123123123',//时间戳 "submit_time_start" => '123123123123',//时间戳
"submit_time_end" => '123123', "submit_time_end" => '123123',
"type" => 10,//入账类型, 10.意向金 30.保管金 91.中介费 92.案场费 "type" => 10,//入账类型, 10.意向金 30.保管金 91.中介费 92.案场费
"source" => 0,//来源0app 1智能pos机 2调整 "source" => 0,//来源0app 1智能pos机 2调整
"is_open" => 0, //是否开业:0未开业 1开业 "is_open" => 0, //是否开业:0未开业 1开业
"is_all" => 0, //是否查看全部:0自己 1全部 "is_all" => 0, //是否查看全部:0自己 1全部
"page_no" => 1, "page_no" => 1,
"page_size" => 15 "page_size" => 15
);*/ );*/
if (!isset($params["agent_id"])) { if (!isset($params["agent_id"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$pageNo = empty($params['page_no']) ? 1 : $params['page_no']; $pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size']; $pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$agentModel = new AAgents(); $agentModel = new AAgents();
$agents_data = $agentModel->getAgentInfo('id,level', $this->agentId); $agents_data = $agentModel->getAgentInfo('id,level', $this->agentId);
$result = []; $result = [];
...@@ -279,6 +271,5 @@ class PayLog extends Basic ...@@ -279,6 +271,5 @@ class PayLog extends Basic
} else { } else {
return $this->response("200", "request null"); return $this->response("200", "request null");
} }
} }
} }
\ No newline at end of file
...@@ -1092,6 +1092,7 @@ Route::group('office', [ ...@@ -1092,6 +1092,7 @@ Route::group('office', [
'adjustment' => ['api_broker/OfficePayLog/adjustment', ['method' => 'get|post']], 'adjustment' => ['api_broker/OfficePayLog/adjustment', ['method' => 'get|post']],
'refund' => ['api_broker/OfficePayLog/refund', ['method' => 'get|post']], 'refund' => ['api_broker/OfficePayLog/refund', ['method' => 'get|post']],
'getRefund' => ['api_broker/OfficePayLog/getRefund', ['method' => 'get|post']], 'getRefund' => ['api_broker/OfficePayLog/getRefund', ['method' => 'get|post']],
'myRefundList' => ['api_broker/OfficePayLog/myRefundList', ['method' => 'get']], //退款审核
'bargainListSearchBargainId' => ['api_broker/OfficeBargain/bargainListSearchBargainId', ['method' => 'POST|GET']], 'bargainListSearchBargainId' => ['api_broker/OfficeBargain/bargainListSearchBargainId', ['method' => 'POST|GET']],
'bargainMain' => ['api_broker/OfficeBargain/bargainList', ['method' => 'POST|GET']], 'bargainMain' => ['api_broker/OfficeBargain/bargainList', ['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