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
6d2f76ca
Commit
6d2f76ca
authored
Aug 07, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户详情上一页下一页接口
parent
50041d45
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
104 additions
and
0 deletions
+104
-0
User.php
application/api_broker/controller/User.php
+53
-0
UserGetLastOrNextUserIdValidate.php
...n/api_broker/validate/UserGetLastOrNextUserIdValidate.php
+31
-0
Remark.php
application/index/controller/Remark.php
+3
-0
Users.php
application/model/Users.php
+14
-0
route.php
application/route.php
+3
-0
No files found.
application/api_broker/controller/User.php
View file @
6d2f76ca
...
@@ -138,4 +138,56 @@ class User extends Basic
...
@@ -138,4 +138,56 @@ class User extends Basic
return
$this
->
response
(
"200"
,
'request success'
,
$data
);
return
$this
->
response
(
"200"
,
'request success'
,
$data
);
}
}
/**
* 客户详情上一页下一页接口
* @return \think\Response
* 朱伟 2018-08-07
*/
public
function
getLastOrNextUserID
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"user_id" => 3,
"agent_id" => 9,
"type" =>"last",
);*/
$checkResult
=
$this
->
validate
(
$params
,
"UserGetLastOrNextUserIdValidate.verifyStatus"
);
if
(
true
!==
$checkResult
)
{
return
$this
->
response
(
"300"
,
$checkResult
);
}
//todo 判断是 杭州还是上海
$where
[
'city'
]
=
'上海市'
;
if
(
$params
[
'type'
]
==
'last'
){
$where
[
'id'
]
=
[
'gt'
,
$params
[
'user_id'
]];
}
else
{
$where
[
'id'
]
=
[
'lt'
,
$params
[
'user_id'
]];
}
//dump($where);
$field
=
'id,user_nick,agent_id,vip'
;
$user
=
new
Users
();
$user_res
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
1
);
//todo 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看
//vip客户 0:否 1:是
if
((
$user_res
[
'vip'
]
==
1
)
&&
(
$user_res
[
'agent_id'
]
!=
$params
[
'agent_id'
])){
return
$this
->
response
(
"200"
,
"不符合条件"
,
[]);
}
//todo 判断
$clientService
=
new
ClientService
();
if
(
$clientService
->
dialTotal
(
$params
[
'user_id'
])){
return
$this
->
response
(
"200"
,
"不符合条件!"
,
[]);
}
$where
=
[];
$where
[
'city'
]
=
'上海市'
;
$field
=
'max(id) as max_id'
;
$max_id
=
$user
->
getLastOrNextUserID
(
$where
,
$field
,
$limit
=
''
);
return
$this
->
response
(
"200"
,
"success!"
,
[
'user_id'
=>
$user_res
[
0
][
'id'
],
'max_user_id'
=>
$max_id
[
0
][
'max_id'
]]);
}
}
}
\ No newline at end of file
application/api_broker/validate/UserGetLastOrNextUserIdValidate.php
0 → 100644
View file @
6d2f76ca
<?php
namespace
app\api_broker\validate
;
use
think\Validate
;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/8/7
* Time: 13:54:12
*/
class
UserGetLastOrNextUserIdValidate
extends
Validate
{
protected
$rule
=
[
'type'
=>
'require'
,
'agent_id'
=>
'require|number|gt:0'
,
'user_id'
=>
'require|number|gt:0'
];
protected
$message
=
[
'type.require'
=>
'网络异常!错误代码:uv1'
,
//type为必填字段
'agent_id.require'
=>
'网络异常!错误代码:uv3'
,
//agent_id为必填字段
'agent_id.number'
=>
'网络异常!错误代码:uv4'
,
//agent_id只能为数字
'agent_id.gt'
=>
'网络异常!错误代码:uv5'
,
//agent_id必须大于0
'user_id.require'
=>
'网络异常!错误代码:uv6'
,
//user_id为必填字段
'user_id.number'
=>
'网络异常!错误代码:uv7'
,
//user_id只能为数字
'user_id.gt'
=>
'网络异常!错误代码:uv8'
,
//user_id必须大于0
];
protected
$scene
=
[
'add_phone_follow_up_verify'
=>
[
'user_id'
,
'agent_id'
,
'type'
],
];
}
application/index/controller/Remark.php
View file @
6d2f76ca
...
@@ -235,4 +235,6 @@ class Remark extends Basic
...
@@ -235,4 +235,6 @@ class Remark extends Basic
//dump($total);
//dump($total);
return
$this
->
response
(
"200"
,
"success!"
,
[
'user_date'
=>
$UPhoneFollowPp_res
,
'pagenum'
=>
$pagenum
,
'total'
=>
$total
]);
return
$this
->
response
(
"200"
,
"success!"
,
[
'user_date'
=>
$UPhoneFollowPp_res
,
'pagenum'
=>
$pagenum
,
'total'
=>
$total
]);
}
}
}
}
\ No newline at end of file
application/model/Users.php
View file @
6d2f76ca
...
@@ -731,5 +731,19 @@ class Users extends Model
...
@@ -731,5 +731,19 @@ class Users extends Model
return
$data
;
return
$data
;
}
}
public
function
getLastOrNextUserID
(
$where
,
$field
,
$limit
)
{
$return
=
Db
::
name
(
$this
->
table
)
->
field
(
$field
)
->
where
(
$where
)
->
limit
(
$limit
)
->
order
(
'id asc'
)
->
select
();
//dump($this->getLastSql());
return
$return
;
}
}
}
application/route.php
View file @
6d2f76ca
...
@@ -190,6 +190,7 @@ Route::group('index', [
...
@@ -190,6 +190,7 @@ Route::group('index', [
'useraction_search'
=>
[
'index/remark/useraction_search'
,
[
'method'
=>
'get|post'
]
],
//后台客户详情
'useraction_search'
=>
[
'index/remark/useraction_search'
,
[
'method'
=>
'get|post'
]
],
//后台客户详情
'select_by_phone'
=>
[
'index/remark/select_by_phone'
,
[
'method'
=>
'get|post'
]
],
//后台客户详情--客方搜索
'select_by_phone'
=>
[
'index/remark/select_by_phone'
,
[
'method'
=>
'get|post'
]
],
//后台客户详情--客方搜索
'getSetting'
=>
[
'index/Setting/getSetting'
,
[
'method'
=>
'get|post'
]
],
//新增和修改全局参数设置
'getSetting'
=>
[
'index/Setting/getSetting'
,
[
'method'
=>
'get|post'
]
],
//新增和修改全局参数设置
'getMenu'
=>
[
'index/Auth/getMenu'
,
[
'method'
=>
'get|post'
]
],
//新增和修改全局参数设置
'getMenu'
=>
[
'index/Auth/getMenu'
,
[
'method'
=>
'get|post'
]
],
//新增和修改全局参数设置
'reportListOne/:check_status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
],
[
'check_status'
=>
1
]
],
//财务 成交报告-未结单-第一级审核
'reportListOne/:check_status'
=>
[
'index/Finance/reportList'
,
[
'method'
=>
'get'
],
[
'check_status'
=>
1
]
],
//财务 成交报告-未结单-第一级审核
...
@@ -520,6 +521,8 @@ Route::group('broker', [
...
@@ -520,6 +521,8 @@ Route::group('broker', [
//user
//user
'returnSearchCondition'
=>
[
'api_broker/User/returnSearchCondition'
,
[
'method'
=>
'get'
]
],
//客户搜索条件
'returnSearchCondition'
=>
[
'api_broker/User/returnSearchCondition'
,
[
'method'
=>
'get'
]
],
//客户搜索条件
'searchUser'
=>
[
'api_broker/User/searchUser'
,
[
'method'
=>
'get|post'
]
],
//客户搜索
'searchUser'
=>
[
'api_broker/User/searchUser'
,
[
'method'
=>
'get|post'
]
],
//客户搜索
'getLastOrNextUserID'
=>
[
'api_broker/User/getLastOrNextUserID'
,
[
'method'
=>
'get|post'
]
],
//客户搜索
'superviseListNew'
=>
[
'api_broker/Supervise/superviseList'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行列表 朱伟 2018-06-15
'superviseListNew'
=>
[
'api_broker/Supervise/superviseList'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行列表 朱伟 2018-06-15
'addSupervise'
=>
[
'api_broker/Supervise/addSupervise'
,
[
'method'
=>
'POST|GET'
]
],
//新增-监督执行 朱伟 2018-06-20
'addSupervise'
=>
[
'api_broker/Supervise/addSupervise'
,
[
'method'
=>
'POST|GET'
]
],
//新增-监督执行 朱伟 2018-06-20
'superviseUploadImg'
=>
[
'api_broker/Supervise/superviseUploadImg'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行-上传图片 朱伟 2018-06-20
'superviseUploadImg'
=>
[
'api_broker/Supervise/superviseUploadImg'
,
[
'method'
=>
'POST|GET'
]
],
//监督执行-上传图片 朱伟 2018-06-20
...
...
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