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
73a04365
Commit
73a04365
authored
Dec 13, 2017
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
咨询经纪人修改查询条件
parent
a68f61ad
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
16 deletions
+10
-16
Broker.php
application/api/controller/Broker.php
+2
-1
Agents.php
application/model/Agents.php
+8
-15
No files found.
application/api/controller/Broker.php
View file @
73a04365
...
...
@@ -33,7 +33,8 @@ class Broker extends Basic{
$agents
=
new
Agents
();
$data
[
'msg'
]
=
''
;
$data
[
'data'
]
=
$agents
->
getUser
(
$pageNo
,
$pageSize
,
''
,
'id,realname,phone'
,
''
,
$params
[
'house_id'
]);
$fields
=
'a.id,realname,phone,COUNT(b.id) evaluate,avg(evaluate_grade) as evaluate_grade'
;
$data
[
'data'
]
=
$agents
->
getUser
(
$pageNo
,
$pageSize
,
'evaluate desc'
,
$fields
,
''
,
$params
[
'house_id'
]);
$data
[
'data'
][
'pageNo'
]
=
$pageNo
;
$data
[
'data'
][
'pageSize'
]
=
$pageSize
;
}
else
{
...
...
application/model/Agents.php
View file @
73a04365
...
...
@@ -20,36 +20,29 @@ class Agents extends Model
*/
public
function
getUser
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$house_id
=
''
)
{
if
(
$house_id
==
''
)
{
$data
=
$this
->
field
(
$field
)
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
where
(
$params
)
->
where
(
'level=2 or level=5'
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$agent_data
=
$this
->
field
(
$field
)
}
else
{
$agent_data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
where
(
'find_in_set('
.
$house_id
.
', house_ids) or find_in_set('
.
$house_id
.
', house_ids2)'
)
->
where
(
$params
)
->
where
(
'level=2 or level=5'
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
$evaluate
=
new
Evaluate
();
foreach
(
$agent_data
as
$k
=>
$v
)
{
$data
[
$k
][
'id'
]
=
$v
->
id
;
$data
[
$k
][
'realname'
]
=
$v
->
realname
;
$data
[
$k
][
'phone'
]
=
$v
->
phone
;
$data
[
$k
][
'evaluate'
]
=
$evaluate
->
where
(
'agents_id'
,
$v
->
id
)
->
count
();
$data
[
$k
][
'evaluate_grade'
]
=
$evaluate
->
where
(
'agents_id'
,
$v
->
id
)
->
avg
(
'evaluate_grade'
);
$data
[
$k
][
'label'
]
=
''
;
}
}
return
$data
;
return
$
agent_
data
;
}
/**
...
...
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