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
1651772a
Commit
1651772a
authored
Apr 26, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
咨询经纪人
parent
653225ef
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
2 deletions
+28
-2
Broker.php
application/api/controller/Broker.php
+9
-1
AAgents.php
application/model/AAgents.php
+19
-1
No files found.
application/api/controller/Broker.php
View file @
1651772a
...
...
@@ -38,10 +38,18 @@ class Broker extends Basic{
$agents
=
new
AAgents
();
$fields
=
'a.id,name,phone,COUNT(b.id) evaluate,sum(evaluate_grade) as evaluate_grade,a.img,d.id as user_id'
;
$fields
=
'a.id,name,phone,COUNT(b.id) evaluate,sum(evaluate_grade) as evaluate_grade,a.img'
;
if
(
!
empty
(
$this
->
userId
))
{
$agent_client
=
$agents
->
getAgentClient
(
$fields
,
[
'c.id'
=>
$this
->
userId
]);
}
$list
=
$agents
->
getUser
(
$pageNo
,
$pageSize
,
'evaluate desc'
,
$fields
,
''
,
$params
[
'house_id'
]);
if
(
!
empty
(
$agent_client
))
{
array_unshift
(
$list
,
$agent_client
);
}
if
(
!
empty
(
$list
))
{
foreach
(
$list
as
$k
=>
$v
)
{
$v
[
'head_portrait'
]
=
AGENTHEADERIMGURL
.
$v
[
'img'
];
...
...
application/model/AAgents.php
View file @
1651772a
...
...
@@ -732,7 +732,6 @@ class AAgents extends BaseModel
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
join
(
'g_houses_to_agents c'
,
'a.id=c.agents_id'
,
'left'
)
->
join
(
'u_users d'
,
'a.id = d.agent_id'
,
'left'
)
->
where
(
'c.houses_id'
,
$house_id
)
->
where
(
'c.type'
,
1
)
->
where
(
$params
)
...
...
@@ -814,4 +813,22 @@ class AAgents extends BaseModel
->
find
();
return
$data
;
}
/**
* 查找客方经纪人
*
* @param string $field
* @param array $params
* @return array|false|\PDOStatement|string|\think\Model
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentClient
(
string
$field
=
'*'
,
array
$params
=
[])
{
return
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
join
(
'u_users c'
,
'a.id = c.agent_id'
,
'left'
)
->
where
(
$params
)
->
find
();
}
}
\ No newline at end of file
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