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
63daf8c1
Commit
63daf8c1
authored
Apr 12, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增分佣经纪人搜索
parent
b719bca0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
136 additions
and
24 deletions
+136
-24
OrderLog.php
application/api_broker/controller/OrderLog.php
+29
-0
OrderLogService.php
application/api_broker/service/OrderLogService.php
+79
-22
GHousesToAgents.php
application/model/GHousesToAgents.php
+7
-2
OReportModel.php
application/model/OReportModel.php
+10
-0
Users.php
application/model/Users.php
+9
-0
route.php
application/route.php
+2
-0
No files found.
application/api_broker/controller/OrderLog.php
View file @
63daf8c1
...
@@ -206,6 +206,35 @@ class OrderLog extends Basic
...
@@ -206,6 +206,35 @@ class OrderLog extends Basic
return
$this
->
response
(
"101"
,
"request faild"
);
return
$this
->
response
(
"101"
,
"request faild"
);
}
}
/**
* 成交报告客户搜索
* @return \think\Response
*/
public
function
searchBargainAgents
()
{
$params
=
$this
->
params
;
/* $params = array(
"type" => 1,//0盘方,1客方,2反签,3独家,4合作方
"order_id" => 1,
);*/
if
(
!
isset
(
$params
[
"type"
])
||
!
isset
(
$params
[
"order_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
try
{
$list
=
$this
->
service_
->
searchBargainAgents
(
$params
[
"type"
],
$params
[
"order_id"
]);
if
(
count
(
$list
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$list
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
catch
(
Exception
$e
)
{
return
$this
->
response
(
"101"
,
"request error,msg:"
.
$e
);
}
}
/**
/**
* 详情页
* 详情页
...
...
application/api_broker/service/OrderLogService.php
View file @
63daf8c1
...
@@ -5,6 +5,7 @@ namespace app\api_broker\service;
...
@@ -5,6 +5,7 @@ namespace app\api_broker\service;
use
app\api\untils\GeTuiUntils
;
use
app\api\untils\GeTuiUntils
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\FollowUpLogModel
;
use
app\model\FollowUpLogModel
;
use
app\model\GHousesToAgents
;
use
app\model\OBargainModel
;
use
app\model\OBargainModel
;
use
app\model\OMarchInModel
;
use
app\model\OMarchInModel
;
use
app\model\OPayLogModel
;
use
app\model\OPayLogModel
;
...
@@ -324,13 +325,13 @@ class OrderLogService
...
@@ -324,13 +325,13 @@ class OrderLogService
if
(
count
(
$bargainData
)
>
0
)
{
if
(
count
(
$bargainData
)
>
0
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
$type
=
"无效"
;
$type
=
"无效"
;
if
(
$v
[
"user_status"
]
==
0
)
{
if
(
$v
[
"user_status"
]
==
0
)
{
$type
=
"求租"
;
$type
=
"求租"
;
}
elseif
(
$v
[
"user_status"
]
==
1
)
{
}
elseif
(
$v
[
"user_status"
]
==
1
)
{
$type
=
"已租"
;
$type
=
"已租"
;
}
}
$v
[
"step_name"
]
=
"phone_follow_up"
;
$v
[
"step_name"
]
=
"phone_follow_up"
;
$v
[
"step"
]
=
"电话跟进:"
.
$v
[
'content'
]
.
"【"
.
$type
.
"】"
;
$v
[
"step"
]
=
"电话跟进:"
.
$v
[
'content'
]
.
"【"
.
$type
.
"】"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
...
@@ -341,14 +342,14 @@ class OrderLogService
...
@@ -341,14 +342,14 @@ class OrderLogService
if
(
count
(
$bargainData
)
>
0
)
{
if
(
count
(
$bargainData
)
>
0
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
$type
=
"无效"
;
$type
=
"无效"
;
if
(
$v
[
"user_status"
]
==
0
)
{
if
(
$v
[
"user_status"
]
==
0
)
{
$type
=
"求租"
;
$type
=
"求租"
;
}
elseif
(
$v
[
"user_status"
]
==
1
)
{
}
elseif
(
$v
[
"user_status"
]
==
1
)
{
$type
=
"已租"
;
$type
=
"已租"
;
}
}
$v
[
"step_name"
]
=
"follow_up"
;
$v
[
"step_name"
]
=
"follow_up"
;
$v
[
"step"
]
=
"跟进:"
.
$v
[
'content'
]
.
"【"
.
$type
.
"】"
;
$v
[
"step"
]
=
"跟进:"
.
$v
[
'content'
]
.
"【"
.
$type
.
"】"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -356,7 +357,7 @@ class OrderLogService
...
@@ -356,7 +357,7 @@ class OrderLogService
$field_report
=
"a.id,a.create_time,b.id as order_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name"
;
$field_report
=
"a.id,a.create_time,b.id as order_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name"
;
$reportData
=
$oReportModel
->
selectReportByUserId
(
$field_report
,
[
"user_id"
=>
$user_id
]);
$reportData
=
$oReportModel
->
selectReportByUserId
(
$field_report
,
[
"user_id"
=>
$user_id
]);
if
(
count
(
$result
)
<=
0
&&
count
(
$reportData
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
&&
count
(
$reportData
)
<=
0
)
{
return
[];
return
[];
}
}
...
@@ -364,7 +365,7 @@ class OrderLogService
...
@@ -364,7 +365,7 @@ class OrderLogService
//报备
//报备
foreach
(
$reportData
as
$k
=>
$v
)
{
foreach
(
$reportData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"report"
;
$v
[
"step_name"
]
=
"report"
;
$v
[
"step"
]
=
"报备【"
.
$v
[
'house_title'
]
.
"】"
;
$v
[
"step"
]
=
"报备【"
.
$v
[
'house_title'
]
.
"】"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
$order_ids
.=
$v
[
"order_id"
]
.
","
;
$order_ids
.=
$v
[
"order_id"
]
.
","
;
...
@@ -374,8 +375,8 @@ class OrderLogService
...
@@ -374,8 +375,8 @@ class OrderLogService
$report_ids
=
rtrim
(
$report_ids
,
","
);
$report_ids
=
rtrim
(
$report_ids
,
","
);
}
}
$orderParams
[
"order_id"
]
=
array
(
"in"
,
$order_ids
);
$orderParams
[
"order_id"
]
=
array
(
"in"
,
$order_ids
);
$orderParams
[
"house_title"
]
=
array
(
"like"
,
"%"
.
trim
(
$search
)
.
"%"
);
$orderParams
[
"house_title"
]
=
array
(
"like"
,
"%"
.
trim
(
$search
)
.
"%"
);
$reportParams
[
"report_id"
]
=
array
(
"in"
,
$report_ids
);
$reportParams
[
"report_id"
]
=
array
(
"in"
,
$report_ids
);
...
@@ -385,7 +386,7 @@ class OrderLogService
...
@@ -385,7 +386,7 @@ class OrderLogService
if
(
count
(
$marchInData
)
>
0
)
{
if
(
count
(
$marchInData
)
>
0
)
{
foreach
(
$marchInData
as
$k
=>
$v
)
{
foreach
(
$marchInData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"march_in"
;
$v
[
"step_name"
]
=
"march_in"
;
$v
[
"step"
]
=
"进场【"
.
$v
[
'house_title'
]
.
"】"
;
$v
[
"step"
]
=
"进场【"
.
$v
[
'house_title'
]
.
"】"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -396,11 +397,11 @@ class OrderLogService
...
@@ -396,11 +397,11 @@ class OrderLogService
if
(
count
(
$followUpLogData
)
>
0
)
{
if
(
count
(
$followUpLogData
)
>
0
)
{
foreach
(
$followUpLogData
as
$k
=>
$v
)
{
foreach
(
$followUpLogData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"follow_up_log"
;
$v
[
"step_name"
]
=
"follow_up_log"
;
$v
[
"step"
]
=
"跟进"
;
$v
[
"step"
]
=
"跟进"
;
$v
=
$this
->
convertFollowUp
(
$v
);
$v
=
$this
->
convertFollowUp
(
$v
);
$v
[
"explain_img"
]
=
CHAT_IMG_URL
.
$v
[
"explain_img"
];
$v
[
"explain_img"
]
=
CHAT_IMG_URL
.
$v
[
"explain_img"
];
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -410,7 +411,7 @@ class OrderLogService
...
@@ -410,7 +411,7 @@ class OrderLogService
if
(
count
(
$payLogData
)
>
0
)
{
if
(
count
(
$payLogData
)
>
0
)
{
foreach
(
$payLogData
as
$k
=>
$v
)
{
foreach
(
$payLogData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"pay_log"
;
$v
[
"step_name"
]
=
"pay_log"
;
$v
[
"step"
]
=
"收款【"
.
$v
[
'house_title'
]
.
"】"
;
$v
[
"step"
]
=
"收款【"
.
$v
[
'house_title'
]
.
"】"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -419,11 +420,11 @@ class OrderLogService
...
@@ -419,11 +420,11 @@ class OrderLogService
$field_refund
=
"a.id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name"
;
$field_refund
=
"a.id,a.create_time,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name"
;
$refundData
=
$oRefundModel
->
getRefundByOrderId
(
$field_refund
,
$orderParams
);
$refundData
=
$oRefundModel
->
getRefundByOrderId
(
$field_refund
,
$orderParams
);
if
(
count
(
$refundData
)
>
0
)
{
if
(
count
(
$refundData
)
>
0
)
{
foreach
(
$refundData
as
$k
=>
$v
)
{
foreach
(
$refundData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"refund"
;
$v
[
"step_name"
]
=
"refund"
;
$v
[
"step"
]
=
"退款【"
.
$v
[
'house_title'
]
.
"】"
;
$v
[
"step"
]
=
"退款【"
.
$v
[
'house_title'
]
.
"】"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
...
@@ -434,13 +435,12 @@ class OrderLogService
...
@@ -434,13 +435,12 @@ class OrderLogService
if
(
count
(
$bargainData
)
>
0
)
{
if
(
count
(
$bargainData
)
>
0
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
$v
[
"step_name"
]
=
"bargain"
;
$v
[
"step_name"
]
=
"bargain"
;
$v
[
"step"
]
=
"成交报告【"
.
$v
[
'house_title'
]
.
"】"
;
$v
[
"step"
]
=
"成交报告【"
.
$v
[
'house_title'
]
.
"】"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
}
}
return
$this
->
sortByTime
(
$result
);
return
$this
->
sortByTime
(
$result
);
}
}
...
@@ -690,4 +690,60 @@ class OrderLogService
...
@@ -690,4 +690,60 @@ class OrderLogService
}
}
}
}
/**
* 成交报告客户搜索
* @param $type
* @param $order_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public
function
searchBargainAgents
(
$type
,
$order_id
)
{
$orderModel
=
new
OrderModel
();
$field
=
"a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone,
c.user_pic,c.sex"
;
$where_
[
"order_id"
]
=
$order_id
;
$result
=
$orderModel
->
selectOrderDetail
(
$field
,
$where_
);
//dump($result);
if
(
count
(
$result
)
<=
0
)
{
return
null
;
}
$houseAgents
=
new
GHousesToAgents
();
$field
=
"b.id,b.phone,b.name"
;
switch
(
$type
)
{
//0盘方,1客方,2反签,3独家,4合作方
case
0
:
$params
[
"a.house_id"
]
=
$result
[
"house_id"
];
$params
[
"a.type"
]
=
2
;
$params
[
"b.status"
]
=
0
;
$list
=
$houseAgents
->
getAgentsByHouseId
(
$field
,
$params
);
break
;
case
1
:
$userModel
=
new
Users
();
$params
[
"a.id"
]
=
$result
[
"user_id"
];
$params
[
"b.status"
]
=
0
;
$list
=
$userModel
->
getAgentByUserId
(
$field
,
$params
);
break
;
case
2
:
//反签 == 报备人
$reportModel
=
new
OReportModel
();
$params
[
"a.order_id"
]
=
$result
[
"id"
];
$params
[
"b.status"
]
=
0
;
$list
=
$reportModel
->
getAgentByOrderId
(
$field
,
$params
);
break
;
case
3
:
$params
[
"a.house_id"
]
=
$result
[
"house_id"
];
$params
[
"a.type"
]
=
3
;
$params
[
"b.status"
]
=
0
;
$list
=
$houseAgents
->
getAgentsByHouseId
(
$field
,
$params
);
break
;
case
4
:
break
;
default
:
return
null
;
}
return
$list
;
}
}
}
\ No newline at end of file
application/model/GHousesToAgents.php
View file @
63daf8c1
...
@@ -161,8 +161,13 @@ class GHousesToAgents extends BaseModel
...
@@ -161,8 +161,13 @@ class GHousesToAgents extends BaseModel
}
}
public
function
getAgentsByHouseId
(
$houseId
){
public
function
getAgentsByHouseId
(
$field
,
$params
){
return
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agent_id = b.id"
,
"left"
)
->
where
(
$params
)
->
select
();
}
}
/**
/**
...
...
application/model/OReportModel.php
View file @
63daf8c1
...
@@ -396,4 +396,13 @@ class OReportModel extends Model
...
@@ -396,4 +396,13 @@ class OReportModel extends Model
$agent_data
=
$this
->
db
->
table
(
'a_agents'
)
->
field
(
'id,device_id'
)
->
where
(
'id'
,
$agent_id
)
->
find
();
$agent_data
=
$this
->
db
->
table
(
'a_agents'
)
->
field
(
'id,device_id'
)
->
where
(
'id'
,
$agent_id
)
->
find
();
return
$agent_data
;
return
$agent_data
;
}
}
public
function
getAgentByOrderId
(
$field
,
$params
){
return
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agent_id = b.id"
,
"left"
)
->
where
(
$params
)
->
select
();
}
}
}
\ No newline at end of file
application/model/Users.php
View file @
63daf8c1
...
@@ -418,4 +418,13 @@ class Users extends Model
...
@@ -418,4 +418,13 @@ class Users extends Model
->
where
(
$where
)
->
where
(
$where
)
->
find
();
->
find
();
}
}
public
function
getAgentByUserId
(
$field
,
$params
){
return
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
alias
(
"a"
)
->
join
(
"a_agents b"
,
"a.agent_id=b.id"
,
"left"
)
->
where
(
$params
)
->
select
();
}
}
}
application/route.php
View file @
63daf8c1
...
@@ -369,6 +369,8 @@ Route::group('broker', [
...
@@ -369,6 +369,8 @@ Route::group('broker', [
'searchAgents'
=>
[
'api_broker/OrderLog/searchAgents'
,
[
'method'
=>
'get'
]
],
'searchAgents'
=>
[
'api_broker/OrderLog/searchAgents'
,
[
'method'
=>
'get'
]
],
'searchBargainList'
=>
[
'api_broker/OrderLog/searchBargainList'
,
[
'method'
=>
'get'
]
],
'searchBargainList'
=>
[
'api_broker/OrderLog/searchBargainList'
,
[
'method'
=>
'get'
]
],
'searchBargainAgents'
=>
[
'api_broker/OrderLog/searchBargainAgents'
,
[
'method'
=>
'get'
]
],
'appAgentAuth'
=>
[
'api_broker/Report/appAgentAuth'
,
[
'method'
=>
'get'
]
],
'appAgentAuth'
=>
[
'api_broker/Report/appAgentAuth'
,
[
'method'
=>
'get'
]
],
...
...
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