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
37311b9c
Commit
37311b9c
authored
Jul 13, 2018
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
统计
parent
b142c709
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
97 additions
and
0 deletions
+97
-0
Report.php
application/api_broker/controller/Report.php
+36
-0
ReportService.php
application/api_broker/service/ReportService.php
+60
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Report.php
View file @
37311b9c
...
...
@@ -115,6 +115,42 @@ class Report extends Basic
}
}
/**
* 获取报备列表 pc
*
* @return \think\Response
*/
public
function
reportListForPc
()
{
/* $params = array(
"agent_id" =>10013,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);*/
$params
=
$this
->
params
;
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$pageNo
=
empty
(
$params
[
'page_no'
])
?
1
:
$params
[
'page_no'
];
$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,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title"
;
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$result
=
$this
->
service_
->
orderListForPc
(
$field
,
$params
,
$pageNo
,
$pageSize
);
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
/**
...
...
application/api_broker/service/ReportService.php
View file @
37311b9c
...
...
@@ -160,6 +160,66 @@ class ReportService
return
null
;
}
/**
* 报备订单列表
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return mixed|null
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public
function
orderListForPc
(
$field
,
$params
,
$pageNo
,
$pageSize
)
{
//todo 获取我报备的我的案场的,如果是店长则获取其下所有的经纪人
$vModel
=
new
VerifyService
();
$agentArr
=
$vModel
->
getAgentsByAgentId
(
$params
[
"report_agent_id"
]);
if
(
$agentArr
)
{
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$agentArr
);
$params
[
"report_agent_id"
]
=
$agentArr
;
}
$caseHouseId
=
$vModel
->
getCaseHouseIdByAgentId
(
$params
[
"agent_id_s"
]);
$ids
=
""
;
if
(
count
(
$caseHouseId
)
>
0
)
{
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
);
$count
=
$this
->
oReportModel
->
selectReportCount
(
$field
,
$params
);
$ids_str
=
""
;
if
(
count
(
$result
)
>
0
)
{
foreach
(
$result
as
$k
=>
$v
)
{
//$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
$ids_str
.=
$v
[
"order_id"
]
.
","
;
}
$ids_str
=
rtrim
(
$ids_str
,
","
);
$sign_arr
=
$this
->
orderSign
(
$ids_str
);
foreach
(
$result
as
$k
=>
$v
)
{
$result
[
$k
][
"sign"
]
=
""
;
foreach
(
$sign_arr
as
$value
)
{
if
(
$v
[
"order_id"
]
==
$value
[
"order_id"
])
{
$result
[
$k
][
"sign"
]
.=
$this
->
signTitle
(
$value
[
"type"
])
.
","
;
}
}
}
$data
[
"result"
]
=
$result
;
$data
[
"total"
]
=
$count
[
0
][
"total"
];
return
$data
;
}
return
null
;
}
public
function
orderSign
(
$ids_str
)
{
...
...
application/route.php
View file @
37311b9c
...
...
@@ -428,6 +428,7 @@ Route::group('broker', [
'reportList'
=>
[
'api_broker/Report/reportList'
,
[
'method'
=>
'get'
]
],
'reportListForPc'
=>
[
'api_broker/Report/reportListForPc'
,
[
'method'
=>
'get'
]
],
'orderDetail'
=>
[
'api_broker/OrderLog/orderDetail'
,
[
'method'
=>
'get|post'
]
],
...
...
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