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
788a9dac
Commit
788a9dac
authored
Feb 11, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app客户列表
parent
537feef3
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
0 deletions
+138
-0
Client.php
application/api_broker/controller/Client.php
+84
-0
UPhoneFollowPp.php
application/model/UPhoneFollowPp.php
+31
-0
Users.php
application/model/Users.php
+22
-0
route.php
application/route.php
+1
-0
No files found.
application/api_broker/controller/Client.php
View file @
788a9dac
...
@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
...
@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\model\Users
;
use
app\model\Users
;
use
app\model\UPhoneFollowPp
;
/**
/**
* Created by PhpStorm.
* Created by PhpStorm.
...
@@ -58,4 +59,87 @@ class Client extends Basic
...
@@ -58,4 +59,87 @@ class Client extends Basic
}
}
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
return
$this
->
response
(
$this
->
code
,
$this
->
msg
,
$this
->
data
);
}
}
/**app 经纪人用户列表
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentUserTb
(){
$table
=
new
Users
;
$data
[
'msg'
]
=
''
;
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
//当前时间
$params
=
$this
->
request
->
param
();
$search
=
$params
[
'search'
];
if
(
empty
(
$params
[
'agent_id'
])){
return
$this
->
response
(
100
,
'参数不全'
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//条件
//time_minute_diff 时间差(分)48小时内增加的【拥有经纪人】的客户为--受保护客户
$field
=
[
'id'
,
'user_nick'
,
'user_phone'
,
'agent_id'
,
'referrer_id'
,
'create_time'
,
"TIMESTAMPDIFF(MINUTE,create_time,'
{
$time
}
')as time_minute_diff"
];
$where
=
"agent_id in(0,
{
$params
[
'agent_id'
]
}
)
or TIMESTAMPDIFF(MINUTE,create_time,'
{
$time
}
') > 2880"
;
if
(
!
empty
(
$search
)){
$where
.=
" and user_nick like '%
$search
%' or user_phone like '%
$search
%' "
;
$data
[
'search'
]
=
$search
;
}
$order
=
"id asc"
;
$data
[
'list'
]
=
$table
->
getAgentUserTb
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$where
);
$data
[
'total'
]
=
$table
->
getUserAgentTotal
(
$where
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
/**搜索客户跟进
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
agentUserFollow
(){
$table
=
new
UPhoneFollowPp
;
$data
[
'msg'
]
=
''
;
$params
=
$this
->
request
->
param
();
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
//当前时间
$search
=
$params
[
'search'
];
if
(
empty
(
$params
[
'agent_id'
])){
return
$this
->
response
(
100
,
'参数不全'
);
}
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
[
'f.id'
,
'f.content'
,
'f.create_time'
,
'u.user_pic'
,
"TIMESTAMPDIFF(MINUTE,u.create_time,'
{
$time
}
')as time_minute_diff"
];
$where
=
"agent_id in(0,
{
$params
[
'agent_id'
]
}
)
or TIMESTAMPDIFF(MINUTE,create_time,'
{
$time
}
') > 2880"
;
if
(
!
empty
(
$search
)){
$where
.=
" and f.content like '%
$search
%' "
;
$data
[
'search'
]
=
$search
;
}
$join
=
[[
'u_user u'
,
'u.id=f.user_id'
,
'left'
]];
$order
=
"id asc"
;
$data
[
'list'
]
=
$table
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
);
$data
[
'total'
]
=
$table
->
getUserAgentTotal
(
$where
,
$join
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
}
}
application/model/UPhoneFollowPp.php
View file @
788a9dac
...
@@ -19,4 +19,35 @@ class UPhoneFollowPp extends BaseModel
...
@@ -19,4 +19,35 @@ class UPhoneFollowPp extends BaseModel
{
{
return
$this
->
UPhoneFollowPp
->
find
();
return
$this
->
UPhoneFollowPp
->
find
();
}
}
/**
* @param int $p
* @param int $pageSize
* @param string $order_
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getSearch
(
$p
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$join
,
$where
){
$r
=
$this
->
field
(
$field
)
->
alias
(
'f'
)
->
join
(
$join
)
->
where
(
$where
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$p
)
->
select
();
return
$r
;
}
public
function
getUserAgentTotal
(
$params
,
$join
)
{
$result
=
$this
->
alias
(
'f'
)
->
join
(
$join
)
->
where
(
$params
)
->
count
();
return
$result
;
}
}
}
application/model/Users.php
View file @
788a9dac
...
@@ -146,4 +146,26 @@ class Users extends Model
...
@@ -146,4 +146,26 @@ class Users extends Model
}
}
return
$data
;
return
$data
;
}
}
/**
* @param int $p
* @param int $pageSize
* @param string $order_
* @param $field
* @param $where
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
getAgentUserTb
(
$p
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$where
){
$r
=
$this
->
field
(
$field
)
->
where
(
$where
)
->
order
(
$order_
)
->
limit
(
$pageSize
)
->
page
(
$p
)
->
select
();
return
$r
;
}
}
}
application/route.php
View file @
788a9dac
...
@@ -226,6 +226,7 @@ Route::group('broker', [
...
@@ -226,6 +226,7 @@ Route::group('broker', [
'getLabelsList'
=>
[
'api_broker/label/getLabelsList'
,[
'method'
=>
'get'
]],
//标签列表
'getLabelsList'
=>
[
'api_broker/label/getLabelsList'
,[
'method'
=>
'get'
]],
//标签列表
'add_phone_follow_up'
=>
[
'api_broker/broker/add_phone_follow_up'
,[
'method'
=>
'get|post'
]],
//新增-客户电话跟进
'add_phone_follow_up'
=>
[
'api_broker/broker/add_phone_follow_up'
,[
'method'
=>
'get|post'
]],
//新增-客户电话跟进
'user_search'
=>
[
'api_broker/broker/user_search'
,[
'method'
=>
'get|post'
]],
//客户搜索
'user_search'
=>
[
'api_broker/broker/user_search'
,[
'method'
=>
'get|post'
]],
//客户搜索
'agentUserTb'
=>
[
'api_broker/Client/agentUserTb'
,
[
'method'
=>
'get '
]
],
//客户列表
]);
]);
...
...
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