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
5f8c1215
Commit
5f8c1215
authored
Feb 26, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客方搜索
parent
5c0b7e5b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
81 additions
and
18 deletions
+81
-18
Client.php
application/api_broker/controller/Client.php
+33
-5
Agents.php
application/model/Agents.php
+47
-12
route.php
application/route.php
+1
-1
No files found.
application/api_broker/controller/Client.php
View file @
5f8c1215
...
@@ -3,6 +3,8 @@
...
@@ -3,6 +3,8 @@
namespace
app\api_broker\controller
;
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\index\controller\Agent
;
use
app\model\Agents
;
use
app\model\Users
;
use
app\model\Users
;
use
app\model\UPhoneFollowPp
;
use
app\model\UPhoneFollowPp
;
...
@@ -60,6 +62,34 @@ class Client extends Basic
...
@@ -60,6 +62,34 @@ class Client extends Basic
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
/**经纪人搜索
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentSearch
(){
$table
=
new
Agents
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$search
=
$params
[
'search'
];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
[
'id'
,
'realname'
,
'phone'
];
$where
=
'level in(2,5) '
;
if
(
!
empty
(
$search
)){
$where
.=
" and realname like '%
$search
%' or phone like '%
$search
%' "
;
$data
[
'search'
]
=
$search
;
}
$order
=
"id desc"
;
$data
[
'list'
]
=
$table
->
searchList
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$where
);
$total
=
$table
->
searchTotal
(
$where
);
$data
[
'total'
]
=
ceil
(
$total
/
$pageSize
);
$data
[
'page'
]
=
$pageNo
;
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
/**app 经纪人用户列表
/**app 经纪人用户列表
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DataNotFoundException
...
@@ -98,11 +128,10 @@ class Client extends Basic
...
@@ -98,11 +128,10 @@ class Client extends Basic
}
}
// echo $where;exit;
// echo $where;exit;
$order
=
"id
a
sc"
;
$order
=
"id
de
sc"
;
$data
[
'list'
]
=
$table
->
getAgentUserTb
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$where
);
$data
[
'list'
]
=
$table
->
getAgentUserTb
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$where
);
$total
=
$table
->
getUserAgentTotal
(
$where
);
$total
=
$table
->
getUserAgentTotal
(
$where
);
$total2
=
intval
(
$total
/
$pageSize
);
$data
[
'total'
]
=
ceil
(
$total
/
$pageSize
);
$data
[
'total'
]
=
$total2
==
0
?
1
:
$total2
;
$data
[
'page'
]
=
$pageNo
;
$data
[
'page'
]
=
$pageNo
;
return
$this
->
response
(
200
,
'成功'
,
$data
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
...
@@ -148,8 +177,7 @@ class Client extends Basic
...
@@ -148,8 +177,7 @@ class Client extends Basic
$order
=
"id desc"
;
$order
=
"id desc"
;
$data
[
'list'
]
=
$table
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
,
$group
);
$data
[
'list'
]
=
$table
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
,
$group
);
$total
=
$table
->
getUserAgentTotal
(
$where
,
$join
);
$total
=
$table
->
getUserAgentTotal
(
$where
,
$join
);
$total2
=
intval
(
$total
/
$pageSize
);
$data
[
'total'
]
=
ceil
(
$total
/
$pageSize
);
$data
[
'total'
]
=
$total2
==
0
?
1
:
$total2
;
$data
[
'page'
]
=
$pageNo
;
$data
[
'page'
]
=
$pageNo
;
return
$this
->
response
(
200
,
'成功'
,
$data
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
}
...
...
application/model/Agents.php
View file @
5f8c1215
...
@@ -9,14 +9,16 @@ class Agents extends Model
...
@@ -9,14 +9,16 @@ class Agents extends Model
{
{
/**
/**
* 查询经纪人
* 查询经纪人
*
* @param int $pageNo
* @param type $pageNo
* @param int $pageSize
* @param type $pageSize
* @param string $order_
* @param type $order_
* @param $field
* @param type $field
* @param $params
* @param type $params
* @param string $house_id
* @param type $house_id 查询该街铺和商铺的经纪人评论信息
* @return false|\PDOStatement|string|\think\Collection
* @return type
* @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
=
''
)
{
public
function
getUser
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$params
,
$house_id
=
''
)
{
if
(
$house_id
==
''
)
{
if
(
$house_id
==
''
)
{
...
@@ -44,12 +46,14 @@ class Agents extends Model
...
@@ -44,12 +46,14 @@ class Agents extends Model
return
$data
;
return
$data
;
}
}
/**
/**
* 经纪人详情
* 经纪人详情
*
* @param $id
* @param type $id
* @return array|bool|false|\PDOStatement|string|Model
* @return boolean
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
*/
public
function
agentsDetail
(
$id
)
{
public
function
agentsDetail
(
$id
)
{
if
(
$id
)
{
if
(
$id
)
{
...
@@ -133,4 +137,35 @@ class Agents extends Model
...
@@ -133,4 +137,35 @@ class Agents extends Model
return
$data
;
return
$data
;
}
}
/**
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param string $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
searchList
(
$pageNo
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$where
=
''
){
$r
=
$this
->
field
(
$field
)
->
where
(
$where
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
select
();
return
$r
;
}
/**
* @param $params
* @return int|string
*/
public
function
searchTotal
(
$params
)
{
return
$this
->
where
(
$params
)
->
count
();
}
}
}
application/route.php
View file @
5f8c1215
...
@@ -208,7 +208,7 @@ Route::group('api', [
...
@@ -208,7 +208,7 @@ Route::group('api', [
'agentUserTb'
=>
[
'api_broker/Client/agentUserTb'
,
[
'method'
=>
'get'
]
],
//客户列表
'agentUserTb'
=>
[
'api_broker/Client/agentUserTb'
,
[
'method'
=>
'get'
]
],
//客户列表
'agentUserFollow'
=>
[
'api_broker/Client/agentUserFollow'
,
[
'method'
=>
'get'
]
],
//客户列表
'agentUserFollow'
=>
[
'api_broker/Client/agentUserFollow'
,
[
'method'
=>
'get'
]
],
//客户列表
'agentSearch'
=>
[
'api_broker/Client/agentSearch'
,
[
'method'
=>
'get'
]
],
//经纪人搜索
]);
]);
Route
::
group
(
'task'
,[
Route
::
group
(
'task'
,[
...
...
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