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
9dfb6502
Commit
9dfb6502
authored
Mar 27, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
bc837e32
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
148 additions
and
84 deletions
+148
-84
OrderLog.php
application/api_broker/controller/OrderLog.php
+47
-46
Report.php
application/api_broker/controller/Report.php
+17
-18
OrderLogService.php
application/api_broker/service/OrderLogService.php
+33
-8
PerformanceService.php
application/api_broker/service/PerformanceService.php
+1
-1
ReportService.php
application/api_broker/service/ReportService.php
+18
-8
OReportModel.php
application/model/OReportModel.php
+0
-0
OrderModel.php
application/model/OrderModel.php
+32
-3
No files found.
application/api_broker/controller/OrderLog.php
View file @
9dfb6502
...
@@ -62,21 +62,21 @@ class OrderLog extends Basic
...
@@ -62,21 +62,21 @@ class OrderLog extends Basic
$is_ok
=
$this
->
o_march_in_model
->
addMarchIn
(
$params
);
$is_ok
=
$this
->
o_march_in_model
->
addMarchIn
(
$params
);
$is_ok
=
1
;
$is_ok
=
1
;
if
(
$is_ok
>
0
)
{
if
(
$is_ok
>
0
)
{
$ge_tui
=
new
GeTuiUntils
();
$ge_tui
=
new
GeTuiUntils
();
$report
=
new
OReportModel
();
$report
=
new
OReportModel
();
$field
=
'house_title,user_name'
;
$field
=
'house_title,user_name'
;
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$params
[
"report_id"
]
]);
$report_data
=
$report
->
getReportOrder
(
$field
,
[
'a.id'
=>
$params
[
"report_id"
]
]);
$agent
=
new
AAgents
();
$agent
=
new
AAgents
();
$agent_data
=
$agent
->
getAgentInfo
(
'device_id,store_id'
,
$params
[
'reception_id'
]);
$agent_data
=
$agent
->
getAgentInfo
(
'device_id,store_id'
,
$params
[
'reception_id'
]);
$content
=
"客户
{
$report_data
[
'user_name'
]
}
进场【
{
$report_data
[
'house_title'
]
}
】商铺"
;
$content
=
"客户
{
$report_data
[
'user_name'
]
}
进场【
{
$report_data
[
'house_title'
]
}
】商铺"
;
$where
[
'store_id'
]
=
$agent_data
[
'store_id'
];
$where
[
'store_id'
]
=
$agent_data
[
'store_id'
];
$where
[
'level'
]
=
20
;
$where
[
'level'
]
=
20
;
$agent_store
=
$agent
->
getAgentInfo
(
'id,device_id'
,
''
,
$where
);
$agent_store
=
$agent
->
getAgentInfo
(
'id,device_id'
,
''
,
$where
);
$ge_tui
->
public_push_message_for_one
(
$params
[
'reception_id'
],
$agent_data
[
'device_id'
],
'进场'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$params
[
'reception_id'
],
$agent_data
[
'device_id'
],
'进场'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$agent_store
[
'reception_id'
],
$agent_store
[
'device_id'
],
'进场'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$agent_store
[
'reception_id'
],
$agent_store
[
'device_id'
],
'进场'
,
$content
);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
return
$this
->
response
(
"200"
,
"request success"
,
[]);
}
else
{
}
else
{
...
@@ -287,11 +287,11 @@ class OrderLog extends Basic
...
@@ -287,11 +287,11 @@ class OrderLog extends Basic
public
function
searchOrder
()
public
function
searchOrder
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/*
$params = array(
"type" => 0, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
"type" => 0, //0.客户电话 1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
"agent_id"=>630,
"agent_id"=>630,
"search_keyword" => "14444
"
"search_keyword" => "1
"
);*/
);*/
if
(
!
isset
(
$params
[
"type"
])
||
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"search_keyword"
]))
{
if
(
!
isset
(
$params
[
"type"
])
||
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"search_keyword"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
...
@@ -314,12 +314,12 @@ class OrderLog extends Basic
...
@@ -314,12 +314,12 @@ class OrderLog extends Basic
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"
,
"请求参数错误"
);
}
}
...
@@ -376,12 +376,12 @@ class OrderLog extends Basic
...
@@ -376,12 +376,12 @@ class OrderLog extends Basic
public
function
searchAgents
()
public
function
searchAgents
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
"submit_agent_id" => 1,
"submit_agent_id" => 1,
"keyword" => "157",
"keyword" => "157",
"page_no" => 1,
"page_no" => 1,
"page_size" => 15
"page_size" => 15
);*/
);*/
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"keyword"
]))
{
if
(
!
isset
(
$params
[
"submit_agent_id"
])
||
!
isset
(
$params
[
"keyword"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
@@ -406,7 +406,8 @@ class OrderLog extends Basic
...
@@ -406,7 +406,8 @@ class OrderLog extends Basic
* @return \think\Response
* @return \think\Response
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
addBargain
()
{
public
function
addBargain
()
{
$data
[
'code'
]
=
200
;
$data
[
'code'
]
=
200
;
$data
[
'msg'
]
=
""
;
$data
[
'msg'
]
=
""
;
$data
[
'data'
]
=
[];
$data
[
'data'
]
=
[];
...
@@ -415,27 +416,27 @@ class OrderLog extends Basic
...
@@ -415,27 +416,27 @@ class OrderLog extends Basic
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Id is null.'
;
$data
[
'msg'
]
=
'Id is null.'
;
}
else
{
}
else
{
$bargain
=
new
OBargainModel
();
$bargain
=
new
OBargainModel
();
$bargain_data
=
$bargain
->
get
(
$this
->
params
[
'id'
]);
$bargain_data
=
$bargain
->
get
(
$this
->
params
[
'id'
]);
if
(
empty
(
$bargain_data
))
{
if
(
empty
(
$bargain_data
))
{
$data
[
'code'
]
=
101
;
$data
[
'code'
]
=
101
;
$data
[
'msg'
]
=
'Don\'t have info.'
;
$data
[
'msg'
]
=
'Don\'t have info.'
;
}
else
{
}
else
{
$insert_data
[
'report_id'
]
=
$bargain_data
[
'report_id'
];
$insert_data
[
'report_id'
]
=
$bargain_data
[
'report_id'
];
$insert_data
[
'agent_id'
]
=
$bargain_data
[
'agent_id'
];
$insert_data
[
'agent_id'
]
=
$bargain_data
[
'agent_id'
];
$insert_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$insert_data
[
'order_id'
]
=
$bargain_data
[
'order_id'
];
$insert_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$insert_data
[
'order_no'
]
=
$bargain_data
[
'order_no'
];
$insert_data
[
'trade_type'
]
=
$bargain_data
[
'trade_type'
];
$insert_data
[
'trade_type'
]
=
$bargain_data
[
'trade_type'
];
$insert_data
[
'submit_agent_id'
]
=
$bargain_data
[
'submit_agent_id'
];
$insert_data
[
'submit_agent_id'
]
=
$bargain_data
[
'submit_agent_id'
];
$insert_data
[
'price'
]
=
$bargain_data
[
'price'
];
$insert_data
[
'price'
]
=
$bargain_data
[
'price'
];
$insert_data
[
'commission'
]
=
$bargain_data
[
'commission'
];
$insert_data
[
'commission'
]
=
$bargain_data
[
'commission'
];
$insert_data
[
'status'
]
=
$bargain_data
[
'status'
];
$insert_data
[
'status'
]
=
$bargain_data
[
'status'
];
$insert_data
[
'source'
]
=
1
;
$insert_data
[
'source'
]
=
1
;
$insert_data
[
'role'
]
=
empty
(
$this
->
params
[
'role'
])
?
0
:
$this
->
params
[
'role'
];
$insert_data
[
'role'
]
=
empty
(
$this
->
params
[
'role'
])
?
0
:
$this
->
params
[
'role'
];
$insert_data
[
'scale_fee'
]
=
empty
(
$this
->
params
[
'scale_fee'
])
?
0
:
$this
->
params
[
'scale_fee'
];
$insert_data
[
'scale_fee'
]
=
empty
(
$this
->
params
[
'scale_fee'
])
?
0
:
$this
->
params
[
'scale_fee'
];
$insert_data
[
'practical_fee'
]
=
empty
(
$this
->
params
[
'practical_fee'
])
?
0
:
$this
->
params
[
'practical_fee'
];
$insert_data
[
'practical_fee'
]
=
empty
(
$this
->
params
[
'practical_fee'
])
?
0
:
$this
->
params
[
'practical_fee'
];
$insert_data
[
'father_id'
]
=
empty
(
$this
->
params
[
'id'
])
?
0
:
$this
->
params
[
'id'
];
$insert_data
[
'father_id'
]
=
empty
(
$this
->
params
[
'id'
])
?
0
:
$this
->
params
[
'id'
];
$insert_data
[
'scale'
]
=
empty
(
$this
->
params
[
'scale'
])
?
0
:
$this
->
params
[
'scale'
];
$insert_data
[
'scale'
]
=
empty
(
$this
->
params
[
'scale'
])
?
0
:
$this
->
params
[
'scale'
];
$data
[
'data'
][
'id'
]
=
$bargain
->
insertBargain
(
$insert_data
);
$data
[
'data'
][
'id'
]
=
$bargain
->
insertBargain
(
$insert_data
);
if
(
$data
[
'data'
]
==
0
)
{
if
(
$data
[
'data'
]
==
0
)
{
...
...
application/api_broker/controller/Report.php
View file @
9dfb6502
...
@@ -21,7 +21,6 @@ class Report extends Basic
...
@@ -21,7 +21,6 @@ class Report extends Basic
private
$fulModel
;
private
$fulModel
;
public
function
__construct
(
$request
=
null
)
public
function
__construct
(
$request
=
null
)
{
{
parent
::
__construct
(
$request
);
parent
::
__construct
(
$request
);
...
@@ -82,35 +81,35 @@ class Report extends Basic
...
@@ -82,35 +81,35 @@ class Report extends Basic
* 获取报备列表
* 获取报备列表
* @return \think\Response
* @return \think\Response
*/
*/
public
function
reportList
(){
public
function
reportList
()
/* $params = array(
{
"agent_id" =>1,
/* $params = array(
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"agent_id" =>1,
"page_no"=>1,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_size"=>15
"page_no"=>1,
);*/
"page_size"=>15
);*/
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
]))
{
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
]))
{
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'
];
$field
=
"a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.id as order_id,b.order_no,b.house_id,b.house_title"
;
$field
=
"a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.id as order_id,b.order_no,b.house_id,b.house_title"
;
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
}
/**
/**
* 新增跟进
* 新增跟进
* @return \think\Response
* @return \think\Response
...
@@ -155,10 +154,10 @@ class Report extends Basic
...
@@ -155,10 +154,10 @@ class Report extends Basic
*/
*/
public
function
getFollowUpList
()
public
function
getFollowUpList
()
{
{
/* $params = array(
/* $params = array(
"report_id" => 1,// 报备id
"report_id" => 1,// 报备id
"agent_id" => 1,//非必填 经纪人id 没有就获取最新一条跟进记录
"agent_id" => 1,//非必填 经纪人id 没有就获取最新一条跟进记录
);*/
);*/
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"report_id"
]))
{
if
(
!
isset
(
$params
[
"report_id"
]))
{
...
@@ -182,7 +181,7 @@ class Report extends Basic
...
@@ -182,7 +181,7 @@ class Report extends Basic
return
$this
->
response
(
"300"
,
"not fund list"
,
[]);
return
$this
->
response
(
"300"
,
"not fund list"
,
[]);
}
}
}
catch
(
Exception
$e
)
{
}
catch
(
Exception
$e
)
{
return
$this
->
response
(
"101"
,
"request error:"
.
$e
);
return
$this
->
response
(
"101"
,
"request error:"
.
$e
);
}
}
...
...
application/api_broker/service/OrderLogService.php
View file @
9dfb6502
...
@@ -283,24 +283,29 @@ class OrderLogService
...
@@ -283,24 +283,29 @@ class OrderLogService
*/
*/
public
function
getSearchOrder
(
$params
)
public
function
getSearchOrder
(
$params
)
{
{
$condition
=
[]
;
$condition
=
$where_
=
"1=1 "
;
$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']) . "%" );
$condition
.=
"and b.user_phone like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
break
;
break
;
case
1
:
case
1
:
$condition
[
"b.user_name"
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'search_keyword'
])
.
"%"
);
// $condition["b.user_name"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition
.=
"and b.user_name like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
break
;
break
;
case
2
:
case
2
:
$condition
[
"b.report_agent_phone"
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'search_keyword'
])
.
"%"
);
//$condition["b.report_agent_phone"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition
.=
"and b.report_agent_phone like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
break
;
break
;
case
3
:
case
3
:
$condition
[
"b.report_agent_name"
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'search_keyword'
])
.
"%"
);
//$condition["b.report_agent_name"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition
.=
"and b.report_agent_name like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
break
;
break
;
case
4
:
case
4
:
$condition
[
"b.house_title"
]
=
array
(
'like'
,
"%"
.
trim
(
$params
[
'search_keyword'
])
.
"%"
);
//$condition["b.house_title"] = array( 'like', "%" . trim($params['search_keyword']) . "%" );
$condition
.=
"and b.house_title like '%"
.
trim
(
$params
[
'search_keyword'
])
.
"%' "
;
break
;
break
;
case
5
:
case
5
:
//todo 列表没有显示商铺地址 和产品沟通暂时搁置
//todo 列表没有显示商铺地址 和产品沟通暂时搁置
...
@@ -309,13 +314,33 @@ class OrderLogService
...
@@ -309,13 +314,33 @@ class OrderLogService
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"] );
}*/
$vModel
=
new
VerifyService
();
$agentArr
=
$vModel
->
getAgentsByAgentId
(
$params
[
"report_agent_id"
]);
if
(
$agentArr
)
{
//$params["report_agent_id"] = $agentArr;
$condition
.=
"and b.report_agent_id in ("
.
trim
(
$agentArr
)
.
") "
;
}
$caseHouseId
=
$vModel
->
getCaseHouseIdByAgentId
(
$params
[
"report_agent_id"
]);
$ids
=
""
;
foreach
(
$caseHouseId
as
$item
)
{
$ids
.=
$item
[
"houses_id"
]
.
","
;
}
}
$ids
=
rtrim
(
$ids
,
","
);
$ids
=
$ids
?
$ids
:
0
;
//$params["house_ids"] = $ids;
$where_
.=
"and a.house_id in (
$ids
)"
;
$orderModel
=
new
OrderModel
();
$orderModel
=
new
OrderModel
();
$result
=
$orderModel
->
searchOrder
(
$field
,
$condition
);
$result
=
$orderModel
->
searchOrder
(
$field
,
$condition
,
$where_
);
$ids_str
=
""
;
$ids_str
=
""
;
if
(
count
(
$result
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
)
{
...
...
application/api_broker/service/PerformanceService.php
View file @
9dfb6502
...
@@ -245,7 +245,7 @@ class PerformanceService
...
@@ -245,7 +245,7 @@ class PerformanceService
}
}
p
rivate
function
getOrderList
(
$params
,
$type
)
p
ublic
function
getOrderList
(
$params
,
$type
)
{
{
$result
=
[];
$result
=
[];
//1带看 2进场 3收款 4成交报告
//1带看 2进场 3收款 4成交报告
...
...
application/api_broker/service/ReportService.php
View file @
9dfb6502
...
@@ -77,15 +77,15 @@ class ReportService
...
@@ -77,15 +77,15 @@ class ReportService
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
$house_arr
=
explode
(
","
,
$house_ids
);
$house_arr
=
explode
(
","
,
$house_ids
);
$order_arr
=
[];
$order_arr
=
[];
$agent
=
new
GHousesToAgents
();
$agent
=
new
GHousesToAgents
();
$ge_tui
=
new
GeTuiUntils
();
$ge_tui
=
new
GeTuiUntils
();
foreach
(
$house_arr
as
$k
=>
$v
)
{
foreach
(
$house_arr
as
$k
=>
$v
)
{
//todo 批量插入到数据库
//todo 批量插入到数据库
$order_no
=
$this
->
createOrderNumber
();
$order_no
=
$this
->
createOrderNumber
();
array_push
(
$order_arr
,
$this
->
orderBin
(
$order_no
,
$id
,
$v
));
array_push
(
$order_arr
,
$this
->
orderBin
(
$order_no
,
$id
,
$v
));
$device_id
=
$agent
->
getAgentList
(
$v
);
$device_id
=
$agent
->
getAgentList
(
$v
);
foreach
(
$device_id
as
$k
=>
$v
)
{
foreach
(
$device_id
as
$k
=>
$v
)
{
$content
=
"【
{
$v
[
'store_name'
]
}
】店【
{
$agent_name
}
】约带看【
{
$order_arr
[
'house_title'
]
}
】商铺"
;
$content
=
"【
{
$v
[
'store_name'
]
}
】店【
{
$agent_name
}
】约带看【
{
$order_arr
[
'house_title'
]
}
】商铺"
;
$ge_tui
->
public_push_message_for_one
(
$v
[
'id'
],
$v
[
'device_id'
],
'报备'
,
$content
);
$ge_tui
->
public_push_message_for_one
(
$v
[
'id'
],
$v
[
'device_id'
],
'报备'
,
$content
);
}
}
...
@@ -110,16 +110,25 @@ class ReportService
...
@@ -110,16 +110,25 @@ class ReportService
//todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人
//todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人
$vModel
=
new
VerifyService
();
$vModel
=
new
VerifyService
();
$agentArr
=
$vModel
->
getAgentsByAgentId
(
$params
[
"report_agent_id"
]);
$agentArr
=
$vModel
->
getAgentsByAgentId
(
$params
[
"report_agent_id"
]);
dump
(
$agentArr
);
if
(
$agentArr
)
{
if
(
$agentArr
)
{
$params
[
"report_agent_id"
]
=
array
(
"in"
,
$agentArr
)
;
$params
[
"report_agent_id"
]
=
$agentArr
;
}
}
$result
=
$this
->
oReportModel
->
selectReportList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$caseHouseId
=
$vModel
->
getCaseHouseIdByAgentId
(
$params
[
"report_agent_id"
]);
$ids
=
""
;
foreach
(
$caseHouseId
as
$item
)
{
$ids
.=
$item
[
"houses_id"
]
.
","
;
}
$ids
=
rtrim
(
$ids
,
","
);
$ids
=
$ids
?
$ids
:
0
;
$params
[
"house_ids"
]
=
$ids
;
$result
=
$this
->
oReportModel
->
selectReportList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$ids_str
=
""
;
$ids_str
=
""
;
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
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
[
"order_id"
]
.
","
;
$ids_str
.=
$v
[
"order_id"
]
.
","
;
}
}
...
@@ -141,6 +150,7 @@ class ReportService
...
@@ -141,6 +150,7 @@ class ReportService
return
null
;
return
null
;
}
}
public
function
orderSign
(
$ids_str
)
public
function
orderSign
(
$ids_str
)
{
{
...
...
application/model/OReportModel.php
View file @
9dfb6502
This diff is collapsed.
Click to expand it.
application/model/OrderModel.php
View file @
9dfb6502
...
@@ -98,13 +98,42 @@ class OrderModel extends Model
...
@@ -98,13 +98,42 @@ class OrderModel extends Model
* @param $params
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @return false|\PDOStatement|string|\think\Collection
*/
*/
public
function
searchOrder
(
$field
,
$params
){
public
function
searchOrder
(
$field
,
$params
,
$where_
){
return
$this
->
db_
/* $result = $this->db_
->field($field)
->field($field)
->alias("a")
->alias("a")
->join("o_report b","a.f_id = b.id","left")
->join("o_report b","a.f_id = b.id","left")
->union('SELECT '.$field.' FROM o_order a left join o_report b on a.f_id = b.id where '.$params)
->where($params)
->where($params)
->
select
();
->select();*/
$sql
=
"SELECT * FROM
(
(
SELECT
$field
FROM
`o_order` `a`
LEFT JOIN `o_report` `b` ON `a`.`f_id` = `b`.`id`
WHERE
$params
)
UNION
(
SELECT
$field
FROM
`o_order` `a`
LEFT JOIN `o_report` `b` ON `a`.`f_id` = `b`.`id`
WHERE
$where_
)
) AS aaa"
;
$result
=
$this
->
db_
->
query
(
$sql
);
// 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