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
c0971839
Commit
c0971839
authored
Apr 06, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
咨询经纪人换重构的表
parent
5c70db50
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
13 deletions
+63
-13
Broker.php
application/api/controller/Broker.php
+10
-6
AAgents.php
application/model/AAgents.php
+43
-0
Agents.php
application/model/Agents.php
+10
-7
No files found.
application/api/controller/Broker.php
View file @
c0971839
...
...
@@ -2,6 +2,7 @@
namespace
app\api\controller
;
use
app\api\extend\Basic
;
use
app\model\AAgents
;
use
app\model\Agents
;
use
app\model\Evaluate
;
use
app\model\EvaluateSign
;
...
...
@@ -18,9 +19,12 @@ use app\model\Remarks;
class
Broker
extends
Basic
{
/**
* 获取当前商铺或街铺的经纪人
*
* @return type
* 咨询经纪人
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
index
()
{
$params
=
$this
->
params
;
...
...
@@ -31,14 +35,14 @@ class Broker extends Basic{
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
PAGESIZE
:
$params
[
'pageSize'
];
$agents
=
new
Agents
();
$agents
=
new
A
A
gents
();
$data
[
'msg'
]
=
''
;
$fields
=
'a.id,
realname,phone,COUNT(b.id) evaluate,sum(evaluate_grade) as evaluate_grade,a.head_portrait
'
;
$fields
=
'a.id,
name,phone,COUNT(b.id) evaluate,sum(evaluate_grade) as evaluate_grade,a.img
'
;
$list
=
$agents
->
getUser
(
$pageNo
,
$pageSize
,
'evaluate desc'
,
$fields
,
''
,
$params
[
'house_id'
]);
if
(
$list
)
{
foreach
(
$list
as
$k
=>
$v
)
{
$v
->
head_portrait
=
A
DMIN_URL_TL
.
'user_header/'
.
$v
->
head_portrait
;
$v
->
head_portrait
=
A
GENTHEADERIMGURL
.
$v
->
img
;
$list
[
$k
]
=
$v
->
toArray
();
if
(
$list
[
$k
][
'evaluate_grade'
])
{
...
...
application/model/AAgents.php
View file @
c0971839
...
...
@@ -641,4 +641,46 @@ class AAgents extends BaseModel
->
where
(
'a.id'
,
$agent_id
)
->
find
();
}
/**
* 查询经纪人
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param string $house_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getUser
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$house_id
=
''
)
{
if
(
$house_id
==
''
)
{
$data
=
$this
->
field
(
$field
)
->
alias
(
'a'
)
->
join
(
'u_evaluate b'
,
'a.id = b.agents_id'
,
'left'
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
else
{
$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'
)
->
where
(
'c.houses_id'
,
$house_id
)
->
where
(
'type'
,
1
)
->
where
(
$params
)
->
group
(
'a.id'
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
}
return
$data
;
}
}
\ No newline at end of file
application/model/Agents.php
View file @
c0971839
...
...
@@ -13,13 +13,16 @@ class Agents extends Model
/**
* 查询经纪人
*
* @param type $pageNo
* @param type $pageSize
* @param type $order_
* @param type $field
* @param type $params
* @param type $house_id 查询该街铺和商铺的经纪人评论信息
* @return type
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @param string $house_id
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getUser
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$house_id
=
''
)
{
...
...
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