Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
f37076d3
Commit
f37076d3
authored
Nov 22, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
进场图片
parent
5bc8494f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
130 additions
and
22 deletions
+130
-22
OrderLog.php
application/api_broker/controller/OrderLog.php
+15
-11
OrderLogService.php
application/api_broker/service/OrderLogService.php
+115
-11
No files found.
application/api_broker/controller/OrderLog.php
View file @
f37076d3
...
...
@@ -425,20 +425,24 @@ class OrderLog extends Basic
/**
* 报备时间轴
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectReportAll
V2
()
public
function
selectReportAll
()
{
$params
=
$this
->
params
;
/*
$params = array(
"order_id" => 38024,
);*/
/*
$params = array(
"order_id" => 38024,
);*/
if
(
!
isset
(
$params
[
"order_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$data
=
[]
;
$data
=
$this
->
service_
->
selectListByOrderNo
(
$params
[
"order_id"
])
;
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
/**
* 报备时间轴
*
...
...
@@ -447,16 +451,16 @@ class OrderLog extends Basic
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectReportAll
()
public
function
selectReportAll
V2
()
{
$params
=
$this
->
params
;
/* $params = array(
"order_id" => 38024,
);*/
/* $params = array(
"order_id" => 38024,
);*/
if
(
!
isset
(
$params
[
"order_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$data
=
$this
->
service_
->
selectListByOrderNo
(
$params
[
"order_id"
]);
$data
=
$this
->
service_
->
selectListByOrderNo
V2
(
$params
[
"order_id"
]);
return
$this
->
response
(
"200"
,
"request success"
,
$data
);
}
...
...
application/api_broker/service/OrderLogService.php
View file @
f37076d3
...
...
@@ -340,7 +340,7 @@ class OrderLogService
remark,transfer_img,real_money,source,create_time"
;
$payLogData
=
$oPayLogModel
->
selectPayLogByOrderNo
(
$field_pay_log
,
[
"order_id"
=>
$order_id
]);
if
(
count
(
$payLogData
)
>
0
)
{
$sortPayLogData
=
$this
->
arr2tree
(
$payLogData
);
$sortPayLogData
=
$this
->
arr2tree
(
$payLogData
,
2
);
foreach
(
$sortPayLogData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"pay_log"
;
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
...
...
@@ -376,32 +376,136 @@ class OrderLogService
}
/**
* 查询流程 订单时间轴
* @param $order_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
selectListByOrderNoV2
(
$order_id
)
{
//todo 删除
}
$result
=
[];
$sort
=
0
;
//todo 1.验证订单是否存在
$orderModel
=
new
OrderModel
();
$oReportModel
=
new
OReportModel
();
$oMarchInModel
=
new
OMarchInModel
();
$followUpLogModel
=
new
FollowUpLogModel
();
$oPayLogModel
=
new
OPayLogModel
();
$oRefundModel
=
new
ORefundModel
();
$oBargainModel
=
new
OBargainModel
();
$orderData
=
$orderModel
->
selectOrderByOrderId
(
"a.f_id,a.house_title,b.internal_address"
,
[
"order_id"
=>
$order_id
]);
//dump($orderData);
if
(
count
(
$orderData
)
<=
0
)
{
return
[
"101"
,
"找不到此订单编号"
];
}
$report_id
=
$orderData
[
0
][
"f_id"
];
$field_report
=
"a.id,a.report_agent_id,a.report_agent_phone,a.report_agent_name,a.report_store_id,
a.user_id,a.user_phone,a.user_name,a.vehicle,a.intro,a.predict_see_time,a.create_time,b.store_name,c.district_name"
;
$reportData
=
$oReportModel
->
selectReportInfoById
(
$field_report
,
[
"id"
=>
$report_id
]);
if
(
count
(
$reportData
)
==
0
)
{
return
[
"101"
,
"报备记录未找到"
];
}
//报备
$reportData
[
0
][
"step_name"
]
=
"report"
;
$reportData
[
0
][
"house_title"
]
=
$orderData
[
0
][
"house_title"
];
$reportData
[
0
][
"internal_address"
]
=
$orderData
[
0
][
"internal_address"
];
$result
[
$sort
++
]
=
$reportData
[
0
];
public
function
arr2tree
(
$list
)
//进场 march in
$field_march_in
=
"id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time"
;
$marchInData
=
$oMarchInModel
->
selectMarchInByOrderNo
(
$field_march_in
,
[
"order_id"
=>
$order_id
]);
if
(
count
(
$marchInData
)
>
0
)
{
$marchInData
=
$this
->
arr2tree
(
$marchInData
,
1
);
foreach
(
$marchInData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"march_in"
;
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
}
}
//跟进
$field_follow_up
=
"id,agent_id,agent_name,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
district,business_area,explain,explain_img,create_time"
;
$followUpLogData
=
$followUpLogModel
->
selectFollowUpListByReportId
(
$field_follow_up
,
[
"report_id"
=>
$report_id
]);
if
(
count
(
$followUpLogData
)
>
0
)
{
foreach
(
$followUpLogData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"follow_up_log"
;
$v
=
$this
->
convertFollowUp
(
$v
);
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
}
}
//收款
$field_pay_log
=
"id,order_no,father_id,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type,
remark,transfer_img,real_money,source,create_time"
;
$payLogData
=
$oPayLogModel
->
selectPayLogByOrderNo
(
$field_pay_log
,
[
"order_id"
=>
$order_id
]);
if
(
count
(
$payLogData
)
>
0
)
{
$sortPayLogData
=
$this
->
arr2tree
(
$payLogData
,
2
);
foreach
(
$sortPayLogData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"pay_log"
;
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
}
}
//退款
$field_refund
=
"id,report_id,agent_id,agent_name,order_no,order_id,refund_money,status,name,bank,card_no,
remark,remark_img,create_time"
;
$refundData
=
$oRefundModel
->
selectRefundByOrderNo
(
$field_refund
,
[
"order_id"
=>
$order_id
]);
if
(
count
(
$refundData
)
>
0
)
{
foreach
(
$refundData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"refund"
;
$v
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
$sort
++
]
=
$v
;
}
}
//成交报告
$field_bargain
=
"a.id,a.father_id,a.house_number,a.is_open,a.report_id,a.order_id,a.trade_type,a.submit_agent_id,a.industry_type,
a.estimated_receipt_date,a.submit_agent_name, a.price,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.create_time,b.name,b.phone,a.is_commission"
;
$bargainData
=
$oBargainModel
->
selectBargainListByOrderNo
(
$field_bargain
,
[
"order_id"
=>
$order_id
]);
if
(
count
(
$bargainData
)
>
0
)
{
$bargain_data_arr
=
$this
->
arr2TreeBargain
(
$bargainData
);
foreach
(
$bargain_data_arr
as
$k2
=>
$v2
)
{
$v2
[
"step_name"
]
=
"bargain"
;
$result
[
$sort
++
]
=
$v2
;
}
}
return
$this
->
sortByTime
(
$result
);
}
public
function
arr2tree
(
$list
,
$img_type
)
{
$tree
=
$trees
=
[];
foreach
(
$list
as
$key
=>
$item
)
{
if
(
$item
[
"father_id"
]
==
0
)
{
$list
[
$key
][
"father_id"
]
=
$item
[
"id"
];
if
(
$img_type
==
2
){
foreach
(
$list
as
$key
=>
$item
)
{
if
(
$item
[
"father_id"
]
==
0
)
{
$list
[
$key
][
"father_id"
]
=
$item
[
"id"
];
}
}
}
foreach
(
$list
as
$value
)
{
$tree
[
$value
[
"father_id"
]][]
=
$value
;
foreach
(
$list
as
$value
)
{
$tree
[
$value
[
"father_id"
]][]
=
$value
;
}
}
else
{
$tree
=
$list
;
}
foreach
(
$tree
as
$i
=>
$v
)
{
//查询图片
$oImgModel
=
new
OImg
();
$params
[
"img_id"
]
=
$v
[
0
][
"father_id"
];
$params
[
"img_type"
]
=
2
;
$params
[
"img_type"
]
=
$img_type
;
$img_arr
=
$oImgModel
->
getImgList
(
$params
);
$trees
[
$i
][
"img"
]
=
$img_arr
;
$trees
[
$i
][
"list"
]
=
$v
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment