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
263ac04f
Commit
263ac04f
authored
Feb 28, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
约带看列表
parent
e6785dcb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
5 deletions
+139
-5
Report.php
application/api_broker/controller/Report.php
+57
-1
Basic.php
application/api_broker/extend/Basic.php
+1
-1
ReportService.php
application/api_broker/service/ReportService.php
+30
-3
VerifyService.php
application/api_broker/service/VerifyService.php
+50
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Report.php
View file @
263ac04f
...
...
@@ -136,7 +136,7 @@ class Report extends Basic
if
(
$check
)
{
return
$this
->
response
(
101
,
"暂无权限"
);
}
$result
=
$this
->
service_
->
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$result
=
$this
->
service_
->
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
,
1
);
}
else
{
$result
=
$this
->
service_
->
orderList
(
$field
,
$params
,
$pageNo
,
$pageSize
);
}
...
...
@@ -149,6 +149,62 @@ class Report extends Basic
}
}
public
function
reportListV2
()
{
$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
);
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
=
[];
$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
]);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
/**
* 获取报备列表 pc
* @return \think\Response
...
...
application/api_broker/extend/Basic.php
View file @
263ac04f
...
...
@@ -109,7 +109,7 @@ class Basic extends Controller
$requestPath
=
$this
->
request
->
routeInfo
()[
"rule"
][
0
]
.
"/"
.
$this
->
request
->
routeInfo
()[
"rule"
][
1
];
//过滤掉不需要验证token的接口
if
(
!
in_array
(
trim
(
$requestPath
),
$this
->
filterVerify
))
{
$this
->
tokenVerify
();
//
$this->tokenVerify();
//$this->userAuth(trim($requestPath));
}
unset
(
$this
->
params
[
"AuthToken"
]);
...
...
application/api_broker/service/ReportService.php
View file @
263ac04f
...
...
@@ -112,7 +112,7 @@ class ReportService
// $agentArr = $vModel->getAgentsByAgentId($params["report_agent_id"]);
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$params
[
"report_agent_id"
]
);
$caseHouseId
=
$vModel
->
get
Cas
eHouseIdByAgentId
(
$params
[
"agent_id_s"
]);
$caseHouseId
=
$vModel
->
get
PanpartyAndExclusiv
eHouseIdByAgentId
(
$params
[
"agent_id_s"
]);
$ids
=
""
;
if
(
count
(
$caseHouseId
)
>
0
)
{
foreach
(
$caseHouseId
as
$item
)
{
...
...
@@ -184,9 +184,36 @@ class ReportService
* @throws \think\db\exception\BindParamException
* @throws \think\exception\PDOException
*/
public
function
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
)
public
function
orderListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
,
$check_type
)
{
$result
=
$this
->
oReportModel
->
selectReportListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
);
$vModel
=
new
VerifyService
();
$result
=
[];
switch
(
$check_type
)
{
case
1
:
$result
=
$this
->
oReportModel
->
selectReportListAll
(
$field
,
$params
,
$pageNo
,
$pageSize
);
break
;
case
2
:
case
3
:
$agentArr
=
$vModel
->
getAgentsByAgentIdAndType
(
$params
[
"report_agent_id"
],
$check_type
);
$params
[
"agent_id_s"
]
=
array
(
"in"
,
$agentArr
);
$params
[
"report_agent_id"
]
=
$agentArr
;
$caseHouseId
=
$vModel
->
getPanpartyAndExclusiveHouseIdByAgentId
(
$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
);
break
;
default
:
}
return
$this
->
returnResult
(
$result
);
}
...
...
application/api_broker/service/VerifyService.php
View file @
263ac04f
...
...
@@ -59,6 +59,35 @@ class VerifyService
return
null
;
}
public
function
getAgentsByAgentIdAndType
(
$agent_id
,
$type
)
{
$params
[
"id"
]
=
$agent_id
;
$result
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
if
(
count
(
$result
)
>
0
)
{
$arr_list
=
[];
switch
(
$type
)
{
case
2
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$result
[
0
][
"district_id"
]]);
break
;
case
3
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$result
[
0
][
"store_id"
]]);
break
;
default
:
return
$agent_id
;
break
;
}
$ids
=
""
;
if
(
count
(
$arr_list
)
>
0
)
{
foreach
(
$arr_list
as
$item
)
{
$ids
.=
$item
[
"id"
]
.
","
;
}
}
$ids
=
rtrim
(
$ids
,
","
);
return
$ids
;
}
return
null
;
}
/**
* 经纪人身份验证 获取经纪人
...
...
@@ -196,6 +225,27 @@ class VerifyService
}
/**
* 获取我的盘方和独家
* @param $agent_id
* @return false|null|\PDOStatement|string|\think\Collection
*/
public
function
getPanpartyAndExclusiveHouseIdByAgentId
(
$agent_id
)
{
$houseToAgentModel
=
new
GHousesToAgents
();
$params
[
"a.agents_id"
]
=
$agent_id
;
$params
[
"a.type"
]
=
array
(
"in"
,
'2,3'
);
//盘方和独家
$params
[
"a.is_del"
]
=
0
;
$house_arr
=
$houseToAgentModel
->
getHouseByAgentId
(
"a.houses_id,b.internal_title"
,
$params
);
if
(
count
(
$house_arr
)
>
0
)
{
return
$house_arr
;
}
return
null
;
}
/**
* 获取我的盘方 楼盘
* @param $agent_id
...
...
application/route.php
View file @
263ac04f
...
...
@@ -644,6 +644,7 @@ Route::group('broker', [
'reportList'
=>
[
'api_broker/Report/reportList'
,
[
'method'
=>
'get'
]],
'reportListV2'
=>
[
'api_broker/Report/reportListV2'
,
[
'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