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
edd3a129
Commit
edd3a129
authored
Feb 28, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
9a95a88d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
52 deletions
+43
-52
Report.php
application/api_broker/controller/Report.php
+19
-51
ReportService.php
application/api_broker/service/ReportService.php
+23
-0
route.php
application/route.php
+1
-1
No files found.
application/api_broker/controller/Report.php
View file @
edd3a129
...
...
@@ -131,12 +131,12 @@ class Report extends Basic
$params
[
"report_agent_id"
]
=
$params
[
"agent_id"
];
$result
=
[];
if
(
isset
(
$params
[
"is_all"
])
&&
$params
[
"is_all"
]
==
1
){
$
vip
=
new
VipService
(
);
$check
=
$vip
->
vip
(
$this
->
agentId
,
'index/inspectionRecordAll'
)
;
if
(
$check
)
{
$
check_type
=
$this
->
service_
->
getCheckType
(
$this
->
agentId
);
$check
_type
=
1
;
if
(
$check
_type
==
0
)
{
return
$this
->
response
(
101
,
"暂无权限"
);
}
$result
=
$this
->
service_
->
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
,
1
);
$result
=
$this
->
service_
->
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$check_type
);
}
else
{
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
}
...
...
@@ -149,59 +149,27 @@ class Report extends Basic
}
}
public
function
reportListV2
()
/**
* 获取权限
* @return int|\think\Response
*/
public
function
getCheckType
()
{
$params
=
$this
->
params
;
$params
=
array
(
"agent_id"
=>
5741
,
"type"
=>
2
,
//1表示全部 2表示进场 3 表示收款 4成交报告
"is_all"
=>
1
,
//0搜索我自己的,1全部
"page_no"
=>
1
,
"page_size"
=>
15
);
// $params = array(
// "agent_id" => 5741,
// );
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"type"
])
)
{
if
(
!
isset
(
$params
[
"agent_id"
]))
{
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
=
[];
$check_type
=
0
;
if
(
isset
(
$params
[
"is_all"
])
&&
$params
[
"is_all"
]
==
1
){
$vip
=
new
VipService
();
if
(
$vip
->
vip
(
$this
->
agentId
,
'inspectionRecordAll/3'
)){
//代表公司
$check_type
=
1
;
}
if
(
$vip
->
vip
(
$this
->
agentId
,
'inspectionRecordDistrict/2'
)){
//代表部门
$check_type
=
2
;
}
if
(
$vip
->
vip
(
$this
->
agentId
,
'inspectionRecordStore/1'
)){
//代表门店
$check_type
=
3
;
}
$check_type
=
1
;
if
(
$check_type
==
0
)
{
return
$this
->
response
(
101
,
"暂无权限"
);
}
$result
=
$this
->
service_
->
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$check_type
);
}
else
{
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
}
if
(
count
(
$result
)
>
0
)
{
return
$this
->
response
(
"200"
,
"request success"
,
[
'list'
=>
$result
,
'check_type'
=>
$check_type
]);
$result
=
$this
->
service_
->
getCheckType
(
$this
->
agentId
);
if
(
$result
==
0
)
{
return
$this
->
response
(
101
,
"暂无权限"
);
}
else
{
return
$
this
->
response
(
"200"
,
"request null"
)
;
return
$
result
;
}
}
...
...
application/api_broker/service/ReportService.php
View file @
edd3a129
...
...
@@ -363,4 +363,26 @@ class ReportService
return
$param
;
}
/**
* 获取权限
* @param $agent_id
* @return int
*/
public
function
getCheckType
(
$agent_id
)
{
$vip
=
new
VipService
();
if
(
$vip
->
vip
(
$agent_id
,
'inspectionRecordAll/3'
)){
//代表公司
return
1
;
}
if
(
$vip
->
vip
(
$agent_id
,
'inspectionRecordDistrict/2'
)){
//代表部门
return
2
;
}
if
(
$vip
->
vip
(
$agent_id
,
'inspectionRecordStore/1'
)){
//代表门店
return
3
;
}
return
0
;
}
}
\ No newline at end of file
application/route.php
View file @
edd3a129
...
...
@@ -644,7 +644,7 @@ Route::group('broker', [
'reportList'
=>
[
'api_broker/Report/reportList'
,
[
'method'
=>
'get'
]],
'
reportListV2'
=>
[
'api_broker/Report/reportListV2
'
,
[
'method'
=>
'get'
]],
'
getCheckType'
=>
[
'api_broker/Report/getCheckType
'
,
[
'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