Commit f5b59139 authored by clone's avatar clone

1

parent 9fbab104
...@@ -186,7 +186,7 @@ class PayLog extends Basic ...@@ -186,7 +186,7 @@ class PayLog extends Basic
*/ */
public function myRefundList() public function myRefundList()
{ {
$page_no = empty($this->params["page_no"]) ? 1 : $this->params["page_no"]; $page_no = empty($this->params["page_no"]) ? 1 : $this->params["page_no"];
$page_size = empty($this->params["page_size"]) ? 2 : $this->params["page_size"]; $page_size = empty($this->params["page_size"]) ? 2 : $this->params["page_size"];
// if (empty($this->params['agent_id']))) { // if (empty($this->params['agent_id']))) {
...@@ -213,27 +213,27 @@ class PayLog extends Basic ...@@ -213,27 +213,27 @@ 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;
$m_refund = new OfficeORefundModel(); $m_refund = new OfficeORefundModel();
$m_pay = new OFficeOPayLogModel(); $m_pay = new OFficeOPayLogModel();
$m_order = new OfficeOrderModel(); $m_order = new OfficeOrderModel();
$m_check_log = new OfficeORefundLogModel(); $m_check_log = new OfficeORefundLogModel();
$m_img = new OfficeOImg(); $m_img = new OfficeOImg();
$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);
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']]);
$house_data = $m_order->getHouseInfoByOrderIdOne('a.house_id,b.internal_address', ['a.id' => $v['order_id']]); $house_data = $m_order->getHouseInfoByOrderIdOne('a.house_id,b.internal_address', ['a.id' => $v['order_id']]);
if ($house_data) { if ($house_data) {
$refund_data[$k]['house_id'] = $house_data['house_id']; $refund_data[$k]['house_id'] = $house_data['house_id'];
$refund_data[$k]['house_address'] = $house_data['internal_address']; $refund_data[$k]['house_address'] = $house_data['internal_address'];
} else { } else {
$refund_data[$k]['house_id'] = 0; $refund_data[$k]['house_id'] = 0;
$refund_data[$k]['house_address'] = ''; $refund_data[$k]['house_address'] = '';
} }
$refund_data[$k]['image_array'] = $m_img->getImgList(['img_id' => $v['id'], 'img_type' => 3]); $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]['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/'; $refund_data[$k]['file_path'] = 'static/chat_image/';
} }
return $this->response("101", $refund_data); return $this->response("101", $refund_data);
} }
...@@ -263,25 +263,25 @@ class PayLog extends Basic ...@@ -263,25 +263,25 @@ class PayLog extends Basic
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 = [];
$check_type = 0; $check_type = 0;
if (isset($params["is_all"]) && $params["is_all"] == 1) { if (isset($params["is_all"]) && $params["is_all"] == 1) {
$check_type = 1; $check_type = 1;
if ($agents_data["level"] < 30) { if ($agents_data["level"] < 30) {
$orderLogService = new ReportService(); $orderLogService = new ReportService();
$check_type = $orderLogService->getCheckType($this->agentId); $check_type = $orderLogService->getCheckType($this->agentId);
if ($check_type == 0) { if ($check_type == 0) {
return $this->response(101, "暂无权限"); return $this->response(101, "暂无权限");
} }
} }
} }
$field = "a.type,a.id,a.create_time,a.income_time,a.money,a.type_ext,a.bargain_id,a.is_open,a.source,a.agent_id,a.agent_name"; $field = "a.type,a.id,a.create_time,a.income_time,a.money,a.type_ext,a.bargain_id,a.is_open,a.source,a.agent_id,a.agent_name";
$result = $this->service_->getPayLogList($field, $params, $pageNo, $pageSize, $check_type); $result = $this->service_->getPayLogList($field, $params, $pageNo, $pageSize, $check_type);
if (count($result) > 0) { if (count($result) > 0) {
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
...@@ -289,4 +289,28 @@ class PayLog extends Basic ...@@ -289,4 +289,28 @@ class PayLog extends Basic
return $this->response("200", "request null"); return $this->response("200", "request null");
} }
} }
/**
* 收款详情
*
* @return \think\Response
*/
public function getPayLogDetail()
{
$params = $this->params;
/* $params = array(
"pay_id"=> 1038,
);*/
if (empty($params['pay_id'])) {
return $this->response("101", '参数错误');
}
$result = $this->service_->getCollectionDetail($params['pay_id']);
if ($result) {
return $this->response("200", "success", $result);
} else {
return $this->response("101", "request null");
}
}
} }
\ No newline at end of file
...@@ -2,10 +2,13 @@ ...@@ -2,10 +2,13 @@
namespace app\api_broker\service; namespace app\api_broker\service;
use app\model\OBargainModel;
use app\model\OImg; use app\model\OImg;
use app\model\OPayLogAdjustment; use app\model\OPayLogAdjustment;
use app\model\OPayLogModel; use app\model\OPayLogModel;
use app\model\OrderModel;
use app\model\ORefundModel; use app\model\ORefundModel;
use app\model\OReportModel;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -435,9 +438,86 @@ class PayLogService ...@@ -435,9 +438,86 @@ class PayLogService
default: default:
return ""; return "";
} }
$result = $this->payLogModel->getPayLogList($conditions,$field,$pageNo, $pageSize); return $this->payLogModel->getPayLogList($conditions,$field,$pageNo, $pageSize);
foreach ($result as $item){ }
/**
* 收款详情
*
* @return \think\Response
*/
public function getCollectionDetail($pay_id) {
$pay_data = [];
try {
$m_pay = new OPayLogModel();
$m_bargain = new OBargainModel();
$pay_fields = 'id,order_id,agent_name,create_time,income_time,house_number,type,real_money,income_time,
transfer_name,bargain_id,agent_id,transaction_fee,is_dividend,receipt_number,source,pay_type,last_transfer_time,
money,industry_type,received_money,type_ext,is_open,open_time';
$pay_data = $m_pay->selectReceiptImgList($pay_fields, ['id'=>$pay_id]);
$pay_data = $pay_data[0];
//成交报告id
if (empty($pay_data['bargain_id'])) {
$pay_data['bargain_id'] = "";
$pay_data['is_open'] = 0;
$pay_data['price'] = 0;
} else {
$bargain_where['father_id'] = 0;
$bargain_where['id'] = $pay_data['bargain_id'];
$price = $m_bargain->getFieldValue('price', $bargain_where);
$pay_data['price'] = empty($price)? 0:$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_report = new OReportModel();
$pay_data['current_agent_name'] = $pay_data['store_name'] = "";
if (($pay_data['type'] == 92 || $pay_data['type'] == 91) && $pay_data['bargain_id'] > 0) {
$where[] = ['EXP','a.id ='.$pay_data['bargain_id'].' or father_id='. $pay_data['bargain_id']];
$where['a.status'] = ['in','10,11,13'];
$where['a.role'] = ['in','3,4,5'];
$bargain_data = $m_bargain->agentBargainAll('a.role,a.scale,b.name', $where);
$role_arr = [1=>'盘方', 2=>'客方',3=>'反签',4=>'独家',5=>'合作方',6=>'APP盘下载方',7=>'APP客下载方'];
$name = '';
foreach ($bargain_data as $k=>$v) {
$name .= $v['name'] . '('.$role_arr[$v['role']].$v['scale'].'%),';
}
$pay_data['current_agent_name'] = rtrim($name,',');
}
if (($pay_data['type'] == 10 || $pay_data['type'] == 30) && isset($house_data[0]['f_id'])) {
$current_agent_name = $m_report->selectReportById('report_agent_name,report_store_id', ['id'=>$house_data[0]['f_id']]);
$pay_data['current_agent_name'] = empty($current_agent_name[0]['report_agent_name']) ? "" : $current_agent_name[0]['report_agent_name'];
}
$pay_data['site_id'] = '';
if ($pay_data['agent_id']) {
$redis_service = new RedisCacheService();
$agent_data = $redis_service->getRedisCache(2, $pay_data['agent_id']);
$pay_data['site_id'] = $agent_data['site_id'];
}
$pay_data['open_time'] = empty($pay_data['open_time']) ? '':$pay_data['open_time'];
} catch (\Exception $e) {
return null;
} }
return $pay_data;
} }
} }
\ No newline at end of file
...@@ -975,19 +975,20 @@ Route::group('broker', [ ...@@ -975,19 +975,20 @@ Route::group('broker', [
'getExclusive' => ['api_broker/Shop/getExclusive', ['method' => 'get|post']], 'getExclusive' => ['api_broker/Shop/getExclusive', ['method' => 'get|post']],
'editExclusive' => ['api_broker/Shop/editExclusive', ['method' => 'get|post']], 'editExclusive' => ['api_broker/Shop/editExclusive', ['method' => 'get|post']],
'getBeForNum' => ['api_broker/PayLog/getBeForNum', ['method' => 'get|post']], 'getBeForNum' => ['api_broker/PayLog/getBeForNum', ['method' => 'get|post']],
'adjustment' => ['api_broker/PayLog/adjustment', ['method' => 'get|post']], 'adjustment' => ['api_broker/PayLog/adjustment', ['method' => 'get|post']],
'getPayLogList' => ['api_broker/PayLog/getPayLogList', ['method' => 'get|post']], 'getPayLogList' => ['api_broker/PayLog/getPayLogList', ['method' => 'get|post']],
'getPayLogDetail' => ['api_broker/PayLog/getPayLogDetail', ['method' => 'get|post']],
//原生客户详情 //原生客户详情
'getUserLabels' => ['api_broker/User/getUserLabels', ['method' => 'get|post']],//获取电话跟进标签列表 'getUserLabels' => ['api_broker/User/getUserLabels', ['method' => 'get|post']],//获取电话跟进标签列表
'userDetail' => ['api_broker/User/userDetail', ['method' => 'get|post']],// 'userDetail' => ['api_broker/User/userDetail', ['method' => 'get|post']],//
'userLog' => ['api_broker/User/userLog', ['method' => 'get|post']],// 'userLog' => ['api_broker/User/userLog', ['method' => 'get|post']],//
'followUpLog' => ['api_broker/User/followUpLog', ['method' => 'get|post']],// 'followUpLog' => ['api_broker/User/followUpLog', ['method' => 'get|post']],//
'followUpLogNew' => ['api_broker/User/followUpLogNew', ['method' => 'get|post']],// 'followUpLogNew' => ['api_broker/User/followUpLogNew', ['method' => 'get|post']],//
'userDetailFull' => ['api_broker/User/userDetailFull', ['method' => 'get|post']],// 'userDetailFull' => ['api_broker/User/userDetailFull', ['method' => 'get|post']],//
'addUserBind' => ['api_broker/User/addUserBind', ['method' => 'get|post']], 'addUserBind' => ['api_broker/User/addUserBind', ['method' => 'get|post']],
'removeUserBind' => ['api_broker/User/removeUserBind', ['method' => 'get|post']], 'removeUserBind' => ['api_broker/User/removeUserBind', ['method' => 'get|post']],
'dailyDetail' => ['api_broker/DailyPaper/dailyDetail', ['method' => 'get|post']], 'dailyDetail' => ['api_broker/DailyPaper/dailyDetail', ['method' => 'get|post']],
...@@ -1075,7 +1076,7 @@ Route::group('office', [ ...@@ -1075,7 +1076,7 @@ Route::group('office', [
'addCollectHouse' => ['api_broker/OfficeCollectHouse/addCollectHouse', ['method' => 'POST|GET']], //收藏或取消收藏商铺 'addCollectHouse' => ['api_broker/OfficeCollectHouse/addCollectHouse', ['method' => 'POST|GET']], //收藏或取消收藏商铺
'getCollectHouseList' => ['api_broker/OfficeCollectHouse/getCollectHouseList', ['method' => 'POST|GET']], //查询收藏数据 'getCollectHouseList' => ['api_broker/OfficeCollectHouse/getCollectHouseList', ['method' => 'POST|GET']], //查询收藏数据
'getBuildingRoom' => ['api_broker/OfficeRoom/getBuildingRoom', ['method' => 'POST|GET']], //楼盘列表 'getBuildingRoom' => ['api_broker/OfficeRoom/getBuildingRoom', ['method' => 'POST|GET']], //楼盘列表
'getBuildingRoomH5' => ['api_broker/OfficeRoom/getBuildingRoomH5', ['method' => 'POST|GET']], //楼盘列表 'getBuildingRoomH5' => ['api_broker/OfficeRoom/getBuildingRoomH5', ['method' => 'POST|GET']], //楼盘列表
'report' => ['api_broker/OfficeReport/report', ['method' => 'get|post']], //报备 'report' => ['api_broker/OfficeReport/report', ['method' => 'get|post']], //报备
'addFollowUp' => ['api_broker/OfficeReport/addFollowUp', ['method' => 'get|post']], //新增跟进 'addFollowUp' => ['api_broker/OfficeReport/addFollowUp', ['method' => 'get|post']], //新增跟进
'getFollowUpList' => ['api_broker/OfficeReport/getFollowUpList', ['method' => 'get|post']], 'getFollowUpList' => ['api_broker/OfficeReport/getFollowUpList', ['method' => 'get|post']],
...@@ -1088,10 +1089,10 @@ Route::group('office', [ ...@@ -1088,10 +1089,10 @@ Route::group('office', [
'addShopFollowUp' => ['api_broker/OfficeRoom/addShopFollowUp', ['method' => 'get|post']], 'addShopFollowUp' => ['api_broker/OfficeRoom/addShopFollowUp', ['method' => 'get|post']],
'getMyBuildingRoom' => ['api_broker/OfficeRoom/getMyBuildingRoom', ['method' => 'get|post']], 'getMyBuildingRoom' => ['api_broker/OfficeRoom/getMyBuildingRoom', ['method' => 'get|post']],
'getBeForNum' => ['api_broker/OfficePayLog/getBeForNum', ['method' => 'get|post']], 'getBeForNum' => ['api_broker/OfficePayLog/getBeForNum', ['method' => 'get|post']],
'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']], //退款审核 'myRefundList' => ['api_broker/OfficePayLog/myRefundList', ['method' => 'get']], //退款审核
'bargainListSearchBargainId' => ['api_broker/OfficeBargain/bargainListSearchBargainId', ['method' => 'POST|GET']], 'bargainListSearchBargainId' => ['api_broker/OfficeBargain/bargainListSearchBargainId', ['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