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
8479b739
Commit
8479b739
authored
Mar 06, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log error edit
parent
9e152386
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
25 deletions
+14
-25
Client.php
application/api_broker/controller/Client.php
+13
-25
Broker.php
application/index/controller/Broker.php
+1
-0
No files found.
application/api_broker/controller/Client.php
View file @
8479b739
...
...
@@ -117,45 +117,33 @@ class Client extends Basic
*/
public
function
agentUserTb
(){
header
(
'Access-Control-Allow-Origin:*'
);
$table
=
new
Users
;
$table
=
new
Users
;
$data
[
'msg'
]
=
''
;
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
//当前时间
$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'
];
$pageNo
=
empty
(
$params
[
'pageNo'
])
?
1
:
$params
[
'pageNo'
];
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
//条件
//time_minute_diff 时间差(分)48小时内增加的【拥有经纪人】的客户为--受保护客户
$field
=
[
'id as user_id'
,
'user_nick'
,
'user_phone'
,
'agent_id'
,
'referrer_id'
,
'create_time'
,
"TIMESTAMPDIFF(MINUTE,create_time,'
{
$time
}
')as time_minute_diff"
];
$where
=
" agent_id in(
{
$params
[
'agent_id'
]
}
) "
;
$field
=
[
'id as user_id'
,
'user_nick'
,
'user_phone'
,
'agent_id'
,
'referrer_id'
,
'create_time'
,
"TIMESTAMPDIFF(MINUTE,create_time,'
{
$time
}
')as time_minute_diff"
];
$where
=
" agent_id in(
{
$params
[
'agent_id'
]
}
) "
;
if
(
!
empty
(
$search
)){
if
(
!
empty
(
$params
[
'search'
])){
//搜索客户--可以搜索自己的客户and 不在保护期的客户
$where
=
" (agent_id in(0,
{
$params
[
'agent_id'
]
}
) or agent_id is null or TIMESTAMPDIFF(MINUTE,create_time,'
{
$time
}
') > 2880 )
and ( user_nick like '%
$search
%' or user_phone like '%
$search
%' ) "
;
$data
[
'search'
]
=
$search
;
$where
=
" (agent_id in(0,
{
$params
[
'agent_id'
]
}
) or agent_id is null or TIMESTAMPDIFF(MINUTE,create_time,'
{
$time
}
') > 2880 )
and ( user_nick like '%
{
$params
[
'search'
]
}
%' or user_phone like '%
{
$params
[
'search'
]
}
%' ) "
;
$data
[
'search'
]
=
$params
[
'search'
];
}
// echo $where;exit;
$order
=
"id desc"
;
$data
[
'list'
]
=
$table
->
getAgentUserTb
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$where
);
$total
=
$table
->
getMyUserCount
(
$where
);
$data
[
'total'
]
=
ceil
(
$total
/
$pageSize
);
$data
[
'page'
]
=
$pageNo
;
$data
[
'list'
]
=
$table
->
getAgentUserTb
(
$pageNo
,
$pageSize
,
'id desc'
,
$field
,
$where
);
$total
=
$table
->
getMyUserCount
(
$where
);
$data
[
'total'
]
=
ceil
(
$total
/
$pageSize
);
$data
[
'page'
]
=
$pageNo
;
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
...
...
application/index/controller/Broker.php
View file @
8479b739
...
...
@@ -140,6 +140,7 @@ class Broker extends Basic
case
2
:
$res
=
$hg
->
addAgents
(
$this
->
params
[
'agents_id'
],
$this
->
params
[
'houses_id'
],
$this
->
params
[
'type'
]);
break
;
default
:
$res
=
[];
$data
[
'status'
]
=
101
;
$data
[
'msg'
]
=
'type is null'
;
}
...
...
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