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
dda3ecb9
Commit
dda3ecb9
authored
Feb 26, 2018
by
zfc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索跟进人头像
parent
3391084c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
7 deletions
+18
-7
Client.php
application/api_broker/controller/Client.php
+3
-4
UPhoneFollowPp.php
application/model/UPhoneFollowPp.php
+15
-3
No files found.
application/api_broker/controller/Client.php
View file @
dda3ecb9
...
...
@@ -127,26 +127,25 @@ class Client extends Basic
$pageSize
=
empty
(
$params
[
'pageSize'
])
?
15
:
$params
[
'pageSize'
];
$field
=
[
'f.id'
,
'f.user_id'
,
'f.agent_id'
,
'f.content'
,
'f.create_time'
,
'img.imagename'
,
'a.realname'
,
'a.agentshopname'
,
'a.sub_shopname'
,
"TIMESTAMPDIFF(MINUTE,f.create_time,'
{
$time
}
')as time_minute_diff"
];
$where
=
"(
f.agent_id in(0,
{
$params
[
'agent_id'
]
}
)
) "
;
$where
=
"(
u.agent_id in(0,
{
$params
[
'agent_id'
]
}
) or f.user_id is null or TIMESTAMPDIFF(MINUTE,u.create_time,'
{
$time
}
') > 2880
) "
;
if
(
!
empty
(
$search
)){
$where
.=
" and f.content like '%
$search
%' "
;
$data
[
'search'
]
=
$search
;
}
$group
=
" f.id "
;
$join
=
[[
'agents a'
,
'a.id=f.agent_id'
,
'left'
],
[
'agentsimgs img'
,
'img.agent_id=f.agent_id'
,
'left'
]
];
[
'u_users u'
,
'u.id=f.user_id'
,
'left'
],
];
$order
=
"id desc"
;
$data
[
'list'
]
=
$table
->
getSearch
(
$pageNo
,
$pageSize
,
$order
,
$field
,
$join
,
$where
,
$group
);
$data
[
'total'
]
=
$table
->
getUserAgentTotal
(
$where
,
$join
);
return
$this
->
response
(
200
,
'成功'
,
$data
);
}
}
application/model/UPhoneFollowPp.php
View file @
dda3ecb9
<?php
namespace
app\model
;
use
think\Db
;
class
UPhoneFollowPp
extends
BaseModel
...
...
@@ -32,7 +32,7 @@ class UPhoneFollowPp extends BaseModel
* @throws \think\exception\DbException
*/
public
function
getSearch
(
$p
=
1
,
$pageSize
=
15
,
$order_
=
'id desc'
,
$field
,
$join
,
$where
,
$group
){
$r
=
$this
->
field
(
$field
)
$r
=
$this
->
field
(
$field
)
->
alias
(
'f'
)
->
join
(
$join
)
->
where
(
$where
)
...
...
@@ -41,7 +41,19 @@ class UPhoneFollowPp extends BaseModel
->
limit
(
$pageSize
)
->
page
(
$p
)
->
select
();
return
$r
;
$data
=
array
();
foreach
(
$r
as
$k
=>
$v
){
$data
[
$k
]
=
$v
;
if
(
$v
[
'agent_id'
]){
$data
[
$k
][
'imagename'
]
=
'http://admin.tonglianjituan.com/agentsimg/'
.
Db
::
table
(
'agentsimgs'
)
->
field
(
'imagename'
)
->
where
(
"agent_id=
{
$v
[
'agent_id'
]
}
"
)
->
order
(
'id desc'
)
->
value
(
'imagename'
);
}
}
return
$data
;
}
...
...
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