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
bc9d4462
Commit
bc9d4462
authored
Mar 23, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的成单bug
parent
75ff65cc
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
70 deletions
+148
-70
OrderLog.php
application/api_broker/controller/OrderLog.php
+22
-16
Performance.php
application/api_broker/controller/Performance.php
+2
-2
Statement.php
application/api_broker/controller/Statement.php
+0
-0
Basic.php
application/api_broker/extend/Basic.php
+1
-1
AgentVerifyService.php
application/api_broker/service/AgentVerifyService.php
+53
-0
OrderLogService.php
application/api_broker/service/OrderLogService.php
+59
-46
OBargainModel.php
application/model/OBargainModel.php
+11
-5
No files found.
application/api_broker/controller/OrderLog.php
View file @
bc9d4462
...
@@ -95,7 +95,7 @@ class OrderLog extends Basic
...
@@ -95,7 +95,7 @@ class OrderLog extends Basic
"transfer_img" => "12312312312"
"transfer_img" => "12312312312"
);*/
);*/
$params
[
"collecting_bill"
]
=
json_decode
(
$params
[
"collecting_bill"
],
true
);
$params
[
"collecting_bill"
]
=
json_decode
(
$params
[
"collecting_bill"
],
true
);
$remark
=
isset
(
$params
[
"remark"
])
?
$params
[
"remark"
]
:
""
;
$remark
=
isset
(
$params
[
"remark"
])
?
$params
[
"remark"
]
:
""
;
$transfer_img
=
isset
(
$params
[
"transfer_img"
])
?
$params
[
"transfer_img"
]
:
""
;
$transfer_img
=
isset
(
$params
[
"transfer_img"
])
?
$params
[
"transfer_img"
]
:
""
;
...
@@ -173,7 +173,7 @@ class OrderLog extends Basic
...
@@ -173,7 +173,7 @@ class OrderLog extends Basic
[ "role" => 11, "agent_id" => 12, "scale" => 13, "scale_fee" => 1112 ] ],
[ "role" => 11, "agent_id" => 12, "scale" => 13, "scale_fee" => 1112 ] ],
);*/
);*/
$params
[
"commission_arr"
]
=
json_decode
(
$params
[
"commission_arr"
],
true
);
$params
[
"commission_arr"
]
=
json_decode
(
$params
[
"commission_arr"
],
true
);
$is_ok
=
$this
->
service_
->
addBargain
(
$params
[
"submit_agent_id"
],
$params
[
"report_id"
],
$params
[
"order_id"
],
$params
[
"order_no"
],
$is_ok
=
$this
->
service_
->
addBargain
(
$params
[
"submit_agent_id"
],
$params
[
"report_id"
],
$params
[
"order_id"
],
$params
[
"order_no"
],
$params
[
"trade_type"
],
$params
[
"price"
],
$params
[
"commission"
],
$params
[
"commission_arr"
]);
$params
[
"trade_type"
],
$params
[
"price"
],
$params
[
"commission"
],
$params
[
"commission_arr"
]);
...
@@ -293,16 +293,17 @@ class OrderLog extends Basic
...
@@ -293,16 +293,17 @@ class OrderLog extends Basic
* 我的成交
* 我的成交
* @return \think\Response
* @return \think\Response
*/
*/
public
function
bargainList
(){
public
function
bargainList
()
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
"submit_agent_id" => 1,
"submit_agent_id" => 1,
"status" => 10,
"status" => 10,
"page_no" => 1,
"page_no" => 1,
"page_size"
=>
15
"page_size"
=>
15
);*/
);*/
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"status"
]))
{
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"status"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
try
{
try
{
...
@@ -321,7 +322,8 @@ class OrderLog extends Basic
...
@@ -321,7 +322,8 @@ class OrderLog extends Basic
* 成交报告详情
* 成交报告详情
* @return \think\Response
* @return \think\Response
*/
*/
public
function
bargainDetail
(){
public
function
bargainDetail
()
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
"bargain_id" => 6,
"bargain_id" => 6,
...
@@ -332,9 +334,9 @@ class OrderLog extends Basic
...
@@ -332,9 +334,9 @@ class OrderLog extends Basic
"user_name" =>"nihhkkk",
"user_name" =>"nihhkkk",
"user_phone"=>"123****3333"
"user_phone"=>"123****3333"
);*/
);*/
if
(
!
isset
(
$params
[
"bargain_id"
])
||!
isset
(
$params
[
"house_id"
])
||!
isset
(
$params
[
"house_title"
])
||
!
isset
(
$params
[
"internal_address"
])
if
(
!
isset
(
$params
[
"bargain_id"
])
||
!
isset
(
$params
[
"house_id"
])
||
!
isset
(
$params
[
"house_title"
])
||
!
isset
(
$params
[
"internal_address"
])
||!
isset
(
$params
[
"user_id"
])
||!
isset
(
$params
[
"user_name"
])
||!
isset
(
$params
[
"user_phone"
]))
{
||
!
isset
(
$params
[
"user_id"
])
||
!
isset
(
$params
[
"user_name"
])
||
!
isset
(
$params
[
"user_phone"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
try
{
try
{
...
@@ -353,18 +355,22 @@ class OrderLog extends Basic
...
@@ -353,18 +355,22 @@ class OrderLog extends Basic
/**
/**
* @return \think\Response
* @return \think\Response
*/
*/
public
function
searchAgents
(){
public
function
searchAgents
()
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
"keyword" => "138"
"submit_agent_id" => 1,
"keyword" => "138",
"page_no" => 1,
"page_size" => 15
);*/
);*/
if
(
!
isset
(
$params
[
"keyword"
]))
{
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"keyword"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
try
{
try
{
$result
=
$this
->
service_
->
searchAgents
(
$params
[
"keyword"
]
);
$result
=
$this
->
service_
->
getBargainList
(
$params
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
}
else
{
...
...
application/api_broker/controller/Performance.php
View file @
bc9d4462
...
@@ -30,10 +30,10 @@ class Performance extends Basic{
...
@@ -30,10 +30,10 @@ class Performance extends Basic{
*/
*/
public
function
selectPerformanceByTime
(){
public
function
selectPerformanceByTime
(){
$params
=
$this
->
params
;
$params
=
$this
->
params
;
$params
=
array
(
/*
$params = array(
"agent_id" => 1,
"agent_id" => 1,
"type" => 1, //1表示个人业绩排行 2门店 3区域
"type" => 1, //1表示个人业绩排行 2门店 3区域
);
);
*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
])){
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
...
...
application/api_broker/controller/Statement.php
View file @
bc9d4462
application/api_broker/extend/Basic.php
View file @
bc9d4462
...
@@ -80,7 +80,7 @@ class Basic extends Controller
...
@@ -80,7 +80,7 @@ class Basic extends Controller
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
//过滤掉不需要验证token的接口
//过滤掉不需要验证token的接口
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
$this
->
tokenVerify
();
//
$this->tokenVerify();
}
}
unset
(
$this
->
params
[
"AuthToken"
]);
unset
(
$this
->
params
[
"AuthToken"
]);
}
}
...
...
application/api_broker/service/AgentVerifyService.php
0 → 100644
View file @
bc9d4462
<?php
namespace
app\api_broker\service
;
use
app\model\AAgents
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/23
* Time : 14:11
* Intro:
*/
class
AgentVerifyService
{
private
$agentModel
;
public
function
__construct
()
{
$this
->
agentModel
=
new
AAgents
();
}
public
function
getAgentsByAgentId
(
$agent_id
)
{
$params
[
"id"
]
=
$agent_id
;
$result
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
if
(
count
(
$result
)
>
0
)
{
$arr_list
=
[];
switch
(
$result
[
0
][
"level"
])
{
case
10
:
return
$result
[
0
][
"id"
];
case
20
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$result
[
0
][
"store_id"
]
]);
break
;
case
30
:
case
40
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$result
[
0
][
"district_id"
]
]);
break
;
}
$ids
=
""
;
if
(
count
(
$arr_list
)
>
0
){
foreach
(
$arr_list
as
$item
)
{
$ids
.=
$item
[
"id"
]
.
","
;
}
}
$ids
=
rtrim
(
$ids
,
","
);
return
$ids
;
}
return
null
;
}
}
\ No newline at end of file
application/api_broker/service/OrderLogService.php
View file @
bc9d4462
...
@@ -50,12 +50,12 @@ class OrderLogService
...
@@ -50,12 +50,12 @@ class OrderLogService
$father_id
=
0
;
$father_id
=
0
;
foreach
(
$collecting_bill
as
$collecting
)
{
foreach
(
$collecting_bill
as
$collecting
)
{
if
(
isset
(
$collecting
[
"type"
])
&&
isset
(
$collecting
[
"pay_type"
])
&&
isset
(
$collecting
[
"money"
]))
{
if
(
isset
(
$collecting
[
"type"
])
&&
isset
(
$collecting
[
"pay_type"
])
&&
isset
(
$collecting
[
"money"
]))
{
if
(
$father_id
==
0
)
{
if
(
$father_id
==
0
)
{
$params
=
$this
->
collectingBillBin
(
$father_id
,
$collecting
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$params
=
$this
->
collectingBillBin
(
$father_id
,
$collecting
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$house_number
,
$industry_type
,
$remark
,
$transfer_img
);
$house_number
,
$industry_type
,
$remark
,
$transfer_img
);
$father_id
=
$this
->
payLogModel
->
insertPayLog
(
$params
);
$father_id
=
$this
->
payLogModel
->
insertPayLog
(
$params
);
}
else
{
}
else
{
array_push
(
$bill_arr
,
$this
->
collectingBillBin
(
$father_id
,
$collecting
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
array_push
(
$bill_arr
,
$this
->
collectingBillBin
(
$father_id
,
$collecting
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$house_number
,
$industry_type
,
$remark
,
$transfer_img
));
$house_number
,
$industry_type
,
$remark
,
$transfer_img
));
}
}
}
}
...
@@ -67,7 +67,7 @@ class OrderLogService
...
@@ -67,7 +67,7 @@ class OrderLogService
return
$father_id
;
return
$father_id
;
}
}
private
function
collectingBillBin
(
$father_id
,
$collecting_arr
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$house_number
,
private
function
collectingBillBin
(
$father_id
,
$collecting_arr
,
$agent_id
,
$report_id
,
$order_id
,
$order_no
,
$house_number
,
$industry_type
,
$remark
,
$transfer_img
)
$industry_type
,
$remark
,
$transfer_img
)
{
{
...
@@ -108,12 +108,12 @@ class OrderLogService
...
@@ -108,12 +108,12 @@ class OrderLogService
foreach
(
$commission_arr
as
$commission_val
)
{
foreach
(
$commission_arr
as
$commission_val
)
{
if
(
isset
(
$commission_val
[
"role"
])
&&
isset
(
$commission_val
[
"agent_id"
])
&&
isset
(
$commission_val
[
"scale"
])
if
(
isset
(
$commission_val
[
"role"
])
&&
isset
(
$commission_val
[
"agent_id"
])
&&
isset
(
$commission_val
[
"scale"
])
&&
isset
(
$commission_val
[
"scale_fee"
]))
{
&&
isset
(
$commission_val
[
"scale_fee"
]))
{
if
(
$father_id
==
0
)
{
if
(
$father_id
==
0
)
{
$params
=
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$report_id
,
$order_id
,
$params
=
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
);
$order_no
,
$trade_type
,
$price
,
$commission
);
$father_id
=
$this
->
bargainModel
->
insertBargain
(
$params
);
$father_id
=
$this
->
bargainModel
->
insertBargain
(
$params
);
}
else
{
}
else
{
array_push
(
$bargain_arr
,
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$report_id
,
array_push
(
$bargain_arr
,
$this
->
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
));
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
));
}
}
...
@@ -126,7 +126,7 @@ class OrderLogService
...
@@ -126,7 +126,7 @@ class OrderLogService
return
$father_id
;
return
$father_id
;
}
}
private
function
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
)
private
function
bargainBin
(
$father_id
,
$commission_val
,
$submit_agent_id
,
$report_id
,
$order_id
,
$order_no
,
$trade_type
,
$price
,
$commission
)
{
{
$arr
[
"report_id"
]
=
$report_id
;
$arr
[
"report_id"
]
=
$report_id
;
$arr
[
"father_id"
]
=
$father_id
;
$arr
[
"father_id"
]
=
$father_id
;
...
@@ -150,12 +150,13 @@ class OrderLogService
...
@@ -150,12 +150,13 @@ class OrderLogService
* @param $where_
* @param $where_
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
selectOrderDetail
(
$where_
){
public
function
selectOrderDetail
(
$where_
)
{
$orderModel
=
new
OrderModel
();
$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,
$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"
;
c.user_pic,c.sex"
;
$result
=
$orderModel
->
selectOrderDetail
(
$field
,
$where_
);
$result
=
$orderModel
->
selectOrderDetail
(
$field
,
$where_
);
foreach
(
$result
as
$k
=>
$v
)
{
foreach
(
$result
as
$k
=>
$v
)
{
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$result
[
$k
][
"user_pic"
]
=
HEADERIMGURL
.
$v
[
"user_pic"
];
$result
[
$k
][
"user_pic"
]
=
HEADERIMGURL
.
$v
[
"user_pic"
];
}
}
...
@@ -203,7 +204,7 @@ class OrderLogService
...
@@ -203,7 +204,7 @@ class OrderLogService
$field_march_in
=
"id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time"
;
$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
]);
$marchInData
=
$oMarchInModel
->
selectMarchInByOrderNo
(
$field_march_in
,
[
"order_id"
=>
$order_id
]);
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"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
...
@@ -213,7 +214,7 @@ class OrderLogService
...
@@ -213,7 +214,7 @@ class OrderLogService
district,business_area,explain,explain_img,create_time"
;
district,business_area,explain,explain_img,create_time"
;
$followUpLogData
=
$followUpLogModel
->
selectFollowUpListByReportId
(
$field_follow_up
,
[
"report_id"
=>
$report_id
]);
$followUpLogData
=
$followUpLogModel
->
selectFollowUpListByReportId
(
$field_follow_up
,
[
"report_id"
=>
$report_id
]);
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"
;
...
@@ -226,7 +227,7 @@ class OrderLogService
...
@@ -226,7 +227,7 @@ class OrderLogService
remark,transfer_img,create_time"
;
remark,transfer_img,create_time"
;
$payLogData
=
$oPayLogModel
->
selectPayLogByOrderNo
(
$field_pay_log
,
[
"order_id"
=>
$order_id
]);
$payLogData
=
$oPayLogModel
->
selectPayLogByOrderNo
(
$field_pay_log
,
[
"order_id"
=>
$order_id
]);
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"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
...
@@ -237,7 +238,7 @@ class OrderLogService
...
@@ -237,7 +238,7 @@ class OrderLogService
remark,remark_img,create_time"
;
remark,remark_img,create_time"
;
$refundData
=
$oRefundModel
->
selectRefundByOrderNo
(
$field_refund
,
[
"order_id"
=>
$order_id
]);
$refundData
=
$oRefundModel
->
selectRefundByOrderNo
(
$field_refund
,
[
"order_id"
=>
$order_id
]);
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"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
...
@@ -248,7 +249,7 @@ class OrderLogService
...
@@ -248,7 +249,7 @@ class OrderLogService
scale_fee,create_time"
;
scale_fee,create_time"
;
$bargainData
=
$oBargainModel
->
selectBargainByOrderNo
(
$field_bargain
,
[
"order_id"
=>
$order_id
]);
$bargainData
=
$oBargainModel
->
selectBargainByOrderNo
(
$field_bargain
,
[
"order_id"
=>
$order_id
]);
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"
;
$result
[
$sort
++
]
=
$v
;
$result
[
$sort
++
]
=
$v
;
}
}
...
@@ -264,9 +265,9 @@ class OrderLogService
...
@@ -264,9 +265,9 @@ class OrderLogService
*/
*/
private
function
sortByTime
(
$result
)
private
function
sortByTime
(
$result
)
{
{
for
(
$i
=
0
;
$i
<
count
(
$result
);
$i
++
)
{
for
(
$i
=
0
;
$i
<
count
(
$result
);
$i
++
)
{
for
(
$j
=
$i
+
1
;
$j
<
count
(
$result
)
;
$j
++
)
{
for
(
$j
=
$i
+
1
;
$j
<
count
(
$result
);
$j
++
)
{
if
(
strtotime
(
$result
[
$j
][
"create_time"
])
-
strtotime
(
$result
[
$i
][
"create_time"
])
>
0
)
{
if
(
strtotime
(
$result
[
$j
][
"create_time"
])
-
strtotime
(
$result
[
$i
][
"create_time"
])
>
0
)
{
$temp
=
$result
[
$j
];
$temp
=
$result
[
$j
];
$result
[
$j
]
=
$result
[
$i
];
$result
[
$j
]
=
$result
[
$i
];
$result
[
$i
]
=
$temp
;
$result
[
$i
]
=
$temp
;
...
@@ -280,11 +281,12 @@ class OrderLogService
...
@@ -280,11 +281,12 @@ class OrderLogService
* @param $params 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
* @param $params 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
* @return array|false|\PDOStatement|string|\think\Collection
* @return array|false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getSearchOrder
(
$params
){
public
function
getSearchOrder
(
$params
)
{
$condition
=
[];
$condition
=
[];
$field
=
"a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name,
$field
=
"a.id,a.order_no,a.f_id,a.house_id,a.house_title,b.report_agent_id,b.report_agent_phone,b.report_agent_name,
b.user_id,b.user_phone,b.user_name,b.predict_see_time"
;
b.user_id,b.user_phone,b.user_name,b.predict_see_time"
;
switch
((
int
)
$params
[
"type"
])
{
switch
((
int
)
$params
[
"type"
])
{
case
0
:
case
0
:
$condition
[
"b.user_phone"
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'search_keyword'
])
.
"%"
);
$condition
[
"b.user_phone"
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'search_keyword'
])
.
"%"
);
break
;
break
;
...
@@ -305,23 +307,23 @@ class OrderLogService
...
@@ -305,23 +307,23 @@ class OrderLogService
//$condition["c.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
//$condition["c.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
break
;
break
;
default
:
default
:
return
[
"code"
=>
"101"
,
"msg"
=>
"搜索类型错误"
];
return
[
"code"
=>
"101"
,
"msg"
=>
"搜索类型错误"
];
}
}
if
(
isset
(
$params
[
"agent_id"
]))
{
if
(
isset
(
$params
[
"agent_id"
]))
{
$condition
[
"b.report_agent_id"
]
=
array
(
"eq"
,
$params
[
"agent_id"
]
);
$condition
[
"b.report_agent_id"
]
=
array
(
"eq"
,
$params
[
"agent_id"
]
);
}
}
$orderModel
=
new
OrderModel
();
$orderModel
=
new
OrderModel
();
$result
=
$orderModel
->
searchOrder
(
$field
,
$condition
);
$result
=
$orderModel
->
searchOrder
(
$field
,
$condition
);
$ids_str
=
""
;
$ids_str
=
""
;
if
(
count
(
$result
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
)
{
return
null
;
return
null
;
}
else
{
}
else
{
foreach
(
$result
as
$k
=>
$v
)
{
foreach
(
$result
as
$k
=>
$v
)
{
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$ids_str
.=
$v
[
"id"
]
.
","
;
$ids_str
.=
$v
[
"id"
]
.
","
;
}
}
$ids_str
=
rtrim
(
$ids_str
,
","
);
$ids_str
=
rtrim
(
$ids_str
,
","
);
...
@@ -329,10 +331,10 @@ class OrderLogService
...
@@ -329,10 +331,10 @@ class OrderLogService
$sign_arr
=
$reportService
->
orderSign
(
$ids_str
);
$sign_arr
=
$reportService
->
orderSign
(
$ids_str
);
foreach
(
$result
as
$k
=>
$v
)
{
foreach
(
$result
as
$k
=>
$v
)
{
foreach
(
$sign_arr
as
$value
)
{
foreach
(
$sign_arr
as
$value
)
{
if
(
$v
[
"id"
]
==
$value
[
"order_id"
])
{
if
(
$v
[
"id"
]
==
$value
[
"order_id"
])
{
$result
[
$k
][
"sign"
]
.=
$reportService
->
signTitle
(
$value
[
"type"
])
.
","
;
$result
[
$k
][
"sign"
]
.=
$reportService
->
signTitle
(
$value
[
"type"
])
.
","
;
}
}
}
}
}
}
...
@@ -345,17 +347,24 @@ class OrderLogService
...
@@ -345,17 +347,24 @@ class OrderLogService
* @param $params
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getBargainList
(
$params
){
public
function
getBargainList
(
$params
)
{
$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"
];
$agent_id
=
$params
[
"submit_agent_id"
];
$aService
=
new
AgentVerifyService
();
$ids
=
$aService
->
getAgentsByAgentId
(
$agent_id
);
$params
[
"ids"
]
=
$ids
;
$bargainModel
=
new
OBargainModel
();
$bargainModel
=
new
OBargainModel
();
$filed
=
"a.
id,a.create_time,b.user_phone,b.user_name,b.user_id,d.id as house_id,d.internal_title,d.internal_address"
;
$filed
=
"a.id,a.agent_
id,a.create_time,b.user_phone,b.user_name,b.user_id,d.id as house_id,d.internal_title,d.internal_address"
;
$result
=
$bargainModel
->
selectBargainList
(
$filed
,
$params
,
$pageNo
,
$pageSize
);
$result
=
$bargainModel
->
selectBargainList
(
$filed
,
$params
,
$pageNo
,
$pageSize
);
foreach
(
$result
as
$k
=>
$v
)
{
foreach
(
$result
as
$k
=>
$v
)
{
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
$result
[
$k
][
"create_time"
]
=
date
(
"Y-m-d"
,
strtotime
(
$v
[
"create_time"
]));
$result
[
$k
][
"create_time"
]
=
date
(
"Y-m-d"
,
strtotime
(
$v
[
"create_time"
]));
}
}
return
$result
;
return
$result
;
...
@@ -367,12 +376,13 @@ class OrderLogService
...
@@ -367,12 +376,13 @@ class OrderLogService
* @param $params
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
getBargainDetail
(
$params
){
public
function
getBargainDetail
(
$params
)
{
$bargainModel
=
new
OBargainModel
();
$bargainModel
=
new
OBargainModel
();
$filed
=
"a.id,a.trade_type,a.price,a.submit_agent_id,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.status,
$filed
=
"a.id,a.trade_type,a.price,a.submit_agent_id,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.status,
b.name,b.phone"
;
b.name,b.phone"
;
return
$bargainModel
->
selectBargainDetail
(
$filed
,
$params
);
return
$bargainModel
->
selectBargainDetail
(
$filed
,
$params
);
}
}
...
@@ -381,15 +391,17 @@ class OrderLogService
...
@@ -381,15 +391,17 @@ class OrderLogService
* @param $keyWord
* @param $keyWord
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
searchAgents
(
$keyWord
){
/* public function searchAgents($agent_id, $keyWord)
$params
[
"phone|name"
]
=
array
(
"like"
,
"%
$keyWord
%"
);
{
$params["a.phone|a.name|b."] = array( "like", "%$keyWord%" );
$field
=
"id,store_id,auth_group_id,district_id,level,name,phone"
;
//$field = "id,store_id,auth_group_id,district_id,level,name,phone";
$filed = "a.id,a.create_time,b.user_phone,b.user_name,b.user_id,d.id as house_id,d.internal_title,d.internal_address";
$agentModel = new AAgents();
$agentModel = new AAgents();
return
$agentModel
->
searchAgentsByKeyword
(
$field
,
$params
);
return $agentModel->searchAgentsByKeyword($field,
$params);
}
}
*/
}
}
\ No newline at end of file
application/model/OBargainModel.php
View file @
bc9d4462
...
@@ -114,16 +114,20 @@ class OBargainModel extends Model
...
@@ -114,16 +114,20 @@ class OBargainModel extends Model
*/
*/
public
function
selectBargainList
(
$filed
,
$params
,
$pageNo
,
$pageSize
){
public
function
selectBargainList
(
$filed
,
$params
,
$pageNo
,
$pageSize
){
$where_
=
[];
$where_
=
[];
if
(
isset
(
$params
[
"submit_agent_id"
]))
{
$where_
[
"a.submit_agent_id"
]
=
$params
[
"submit_agent_id"
];
}
if
(
isset
(
$params
[
"status"
]))
{
if
(
isset
(
$params
[
"status"
]))
{
$where_
[
"a.status"
]
=
$params
[
"status"
];
$where_
[
"a.status"
]
=
$params
[
"status"
];
}
}
$where_
[
"a.father_id"
]
=
0
;
if
(
isset
(
$params
[
"ids"
]))
{
$where_
[
"a.agent_id"
]
=
array
(
"in"
,
$params
[
"ids"
]);
}
if
(
isset
(
$params
[
"keyword"
]))
{
$where_
[
"b.user_phone|b.user_name|d.internal_address"
]
=
array
(
"like"
,
"%"
.
$params
[
"keyword"
]
.
"%"
)
;
}
$where_
[
"b.status"
]
=
0
;
$where_
[
"b.status"
]
=
0
;
$where_
[
"c.is_del"
]
=
0
;
$where_
[
"c.is_del"
]
=
0
;
return
$this
->
db_
$result
=
$this
->
db_
->
field
(
$filed
)
->
field
(
$filed
)
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
"o_report b"
,
"a.report_id = b.id"
,
"left"
)
->
join
(
"o_report b"
,
"a.report_id = b.id"
,
"left"
)
...
@@ -134,6 +138,8 @@ class OBargainModel extends Model
...
@@ -134,6 +138,8 @@ class OBargainModel extends Model
->
limit
(
$pageSize
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
page
(
$pageNo
)
->
select
();
->
select
();
echo
$this
->
db_
->
getLastSql
();
return
$result
;
}
}
/**
/**
...
...
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