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
2b82c6eb
Commit
2b82c6eb
authored
Jan 18, 2019
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
b762a3ce
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
16 deletions
+67
-16
VerifyService.php
application/api_broker/service/VerifyService.php
+62
-15
AAgents.php
application/model/AAgents.php
+5
-1
No files found.
application/api_broker/service/VerifyService.php
View file @
2b82c6eb
...
@@ -29,18 +29,65 @@ class VerifyService
...
@@ -29,18 +29,65 @@ class VerifyService
public
function
getAgentsByAgentId
(
$agent_id
)
public
function
getAgentsByAgentId
(
$agent_id
)
{
{
$params
[
"id"
]
=
$agent_id
;
$params
[
"id"
]
=
$agent_id
;
$result
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
$result
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
$arr_list
=
[];
$arr_list
=
[];
switch
(
$result
[
0
][
"level"
])
{
switch
(
$result
[
0
][
"level"
])
{
case
10
:
case
10
:
return
$result
[
0
][
"id"
];
return
$result
[
0
][
"id"
];
case
20
:
case
20
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$result
[
0
][
"store_id"
]
]);
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$result
[
0
][
"store_id"
]
]);
break
;
break
;
case
30
:
case
30
:
case
40
:
case
40
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$result
[
0
][
"district_id"
]
]);
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$result
[
0
][
"district_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
;
}
/**
* 经纪人身份验证 获取经纪人
* @param $agent_id
* @return null|string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentsByAgentIdAndStatus
(
$agent_id
)
{
$params
[
"id"
]
=
$agent_id
;
$params
[
"status"
]
=
array
(
"in"
,
"0,1,3"
);
$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
:
unset
(
$params
[
"id"
]);
$params
[
"store_id"
]
=
$result
[
0
][
"store_id"
];
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
$params
);
break
;
case
30
:
case
40
:
unset
(
$params
[
"id"
]);
$params
[
"district_id"
]
=
$result
[
0
][
"district_id"
];
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
$params
);
break
;
break
;
default
:
default
:
return
$agent_id
;
return
$agent_id
;
...
@@ -71,18 +118,18 @@ class VerifyService
...
@@ -71,18 +118,18 @@ class VerifyService
public
function
getAgentsByWhere
(
$agent_id
)
public
function
getAgentsByWhere
(
$agent_id
)
{
{
$params
[
"id"
]
=
$agent_id
;
$params
[
"id"
]
=
$agent_id
;
$result
=
$this
->
agentModel
->
getAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
$result
=
$this
->
agentModel
->
getAgentsByKeyword
(
"id,store_id,district_id,level"
,
$params
);
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
$arr_list
=
[];
$arr_list
=
[];
switch
(
$result
[
0
][
"level"
])
{
switch
(
$result
[
0
][
"level"
])
{
case
10
:
case
10
:
return
$result
[
0
][
"id"
];
return
$result
[
0
][
"id"
];
case
20
:
case
20
:
$arr_list
=
$this
->
agentModel
->
getAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$result
[
0
][
"store_id"
]]);
$arr_list
=
$this
->
agentModel
->
getAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$result
[
0
][
"store_id"
]]);
break
;
break
;
case
30
:
case
30
:
case
40
:
case
40
:
$arr_list
=
$this
->
agentModel
->
getAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$result
[
0
][
"district_id"
]]);
$arr_list
=
$this
->
agentModel
->
getAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$result
[
0
][
"district_id"
]]);
break
;
break
;
default
:
default
:
return
$agent_id
;
return
$agent_id
;
...
@@ -108,10 +155,10 @@ class VerifyService
...
@@ -108,10 +155,10 @@ class VerifyService
case
1
:
case
1
:
return
$id
;
return
$id
;
case
2
:
case
2
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$id
]);
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"store_id"
=>
$id
]);
break
;
break
;
case
3
:
case
3
:
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$id
]);
$arr_list
=
$this
->
agentModel
->
searchAgentsByKeyword
(
"id"
,
[
"district_id"
=>
$id
]);
break
;
break
;
default
:
default
:
return
$id
;
return
$id
;
...
@@ -135,10 +182,10 @@ class VerifyService
...
@@ -135,10 +182,10 @@ class VerifyService
*/
*/
public
function
getCaseHouseIdByAgentId
(
$agent_id
)
public
function
getCaseHouseIdByAgentId
(
$agent_id
)
{
{
$houseToAgentModel
=
new
GHousesToAgents
();
$houseToAgentModel
=
new
GHousesToAgents
();
$params
[
"a.agents_id"
]
=
$agent_id
;
$params
[
"a.agents_id"
]
=
$agent_id
;
$params
[
"a.type"
]
=
1
;
//案场权限人
$params
[
"a.type"
]
=
1
;
//案场权限人
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.is_del"
]
=
0
;
$house_arr
=
$houseToAgentModel
->
getHouseByAgentId
(
"a.houses_id,b.internal_title"
,
$params
);
$house_arr
=
$houseToAgentModel
->
getHouseByAgentId
(
"a.houses_id,b.internal_title"
,
$params
);
...
@@ -156,11 +203,11 @@ class VerifyService
...
@@ -156,11 +203,11 @@ class VerifyService
*/
*/
public
function
getPanpartyByAgentId
(
$agent_id
)
public
function
getPanpartyByAgentId
(
$agent_id
)
{
{
$houseToAgentModel
=
new
GHousesToAgents
();
$houseToAgentModel
=
new
GHousesToAgents
();
$params
[
"a.agents_id"
]
=
$agent_id
;
$params
[
"a.agents_id"
]
=
$agent_id
;
$params
[
"a.type"
]
=
2
;
$params
[
"a.type"
]
=
2
;
$params
[
"a.is_del"
]
=
0
;
$params
[
"a.is_del"
]
=
0
;
$house_arr
=
$houseToAgentModel
->
getHouseByAgentId
(
"a.houses_id,b.internal_title"
,
$params
);
$house_arr
=
$houseToAgentModel
->
getHouseByAgentId
(
"a.houses_id,b.internal_title"
,
$params
);
$ids
=
""
;
$ids
=
""
;
if
(
count
(
$house_arr
)
>
0
)
{
if
(
count
(
$house_arr
)
>
0
)
{
...
...
application/model/AAgents.php
View file @
2b82c6eb
...
@@ -662,7 +662,11 @@ class AAgents extends BaseModel
...
@@ -662,7 +662,11 @@ class AAgents extends BaseModel
*/
*/
public
function
searchAgentsByKeyword
(
$field
,
$params
)
public
function
searchAgentsByKeyword
(
$field
,
$params
)
{
{
$params
[
"status"
]
=
array
(
"in"
,
"0,3"
);
if
(
!
isset
(
$params
[
"status"
])){
$params
[
"status"
]
=
array
(
"in"
,
"0,3"
);
}
$result
=
Db
::
table
(
$this
->
table
)
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
field
(
$field
)
->
where
(
$params
)
->
where
(
$params
)
...
...
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