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
d76aa2a4
Commit
d76aa2a4
authored
Mar 01, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户动态展示加搜索加客户详情
parent
52889cc4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
40 deletions
+81
-40
Broker.php
application/api_broker/controller/Broker.php
+22
-40
Agents.php
application/model/Agents.php
+9
-0
GOperatingRecords.php
application/model/GOperatingRecords.php
+12
-0
UPhoneFollowPp.php
application/model/UPhoneFollowPp.php
+30
-0
Users.php
application/model/Users.php
+8
-0
No files found.
application/api_broker/controller/Broker.php
View file @
d76aa2a4
...
@@ -12,6 +12,7 @@ namespace app\api_broker\controller;
...
@@ -12,6 +12,7 @@ namespace app\api_broker\controller;
use
app\api\untils\JwtUntils
;
use
app\api\untils\JwtUntils
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\extend\Basic
;
use
app\model\AAgents
;
use
app\model\AAgents
;
use
app\model\GOperatingRecords
;
use
app\model\UPhoneFollowPp
;
use
app\model\UPhoneFollowPp
;
use
app\model\Users
;
use
app\model\Users
;
use
app\model\Agents
;
use
app\model\Agents
;
...
@@ -233,57 +234,38 @@ class Broker extends Basic
...
@@ -233,57 +234,38 @@ class Broker extends Basic
$user_id
=
$params
[
'user_id'
];
$user_id
=
$params
[
'user_id'
];
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
$UPhoneFollowPp
=
new
UPhoneFollowPp
();
// 查询数据集
// 查询电话跟进数据
if
(
$searchdate
){
$UPhoneFollowPp_res
=
$UPhoneFollowPp
->
select_useraction_search
(
$user_id
,
$searchdate
);
$UPhoneFollowPp_res
=
$UPhoneFollowPp
//var_dump($UPhoneFollowPp_res);
->
where
(
'user_id'
,
$user_id
)
->
where
(
'content'
,
$searchdate
)
->
limit
(
$pagesize
)
->
page
(
$pagenum
)
->
select
();
$total
=
$UPhoneFollowPp
->
where
(
'user_id'
,
$user_id
)
->
where
(
'content'
,
$searchdate
)
->
count
();
}
else
{
$UPhoneFollowPp_res
=
$UPhoneFollowPp
->
where
(
'user_id'
,
$user_id
)
->
limit
(
$pagesize
)
->
page
(
$pagenum
)
->
select
();
$total
=
$UPhoneFollowPp
->
where
(
'user_id'
,
$user_id
)
->
count
();
}
$total
=
intval
(
$total
/
$pagesize
)
+
((
$total
%
$pagesize
==
0
)
?
0
:
1
);
/*dump($total);
/*dump($total);
var_dump($user_res);
var_dump($user_res);
exit;*/
exit;*/
//dump($UPhoneFollowPp_res);
foreach
(
$UPhoneFollowPp_res
as
$k
=>
$v
){
$table
=
new
Agents
();
$Agents_res
=
$table
->
Agents_res
(
$v
[
'agent_id'
]);
//dump($Agents_res);
$UPhoneFollowPp_res
[
$k
][
'agentinfo'
]
=
$Agents_res
?
$Agents_res
[
'realname'
]
.
'/'
.
$Agents_res
[
'phone'
]
:
'未知'
;
$UPhoneFollowPp_res
[
$k
][
'user_pic'
]
=
HEADERIMGURL
.
$Agents_res
[
'head_portrait'
];
}
if
(
$UPhoneFollowPp_res
)
{
if
(
$UPhoneFollowPp_res
)
{
$user
=
new
Users
();
$user
=
new
Users
();
// 查询数据集
$user_res
=
$user
->
useraction_search_user_res
(
$user_id
);
$user_res
=
$user
->
where
(
'id'
,
$user_id
)
->
field
(
'id as user_id,agent_id,sex,user_nick,user_pic,user_phone,create_time'
)
->
find
();
$user_res
=
json_decode
(
json_encode
(
$user_res
),
true
);
//对象转数组
//dump($user_res);
//dump($user_res);
$user_res
[
'user_pic'
]
=
HEADERIMGURL
.
$user_res
[
'user_pic'
];
$user_res
[
'user_pic'
]
=
HEADERIMGURL
.
$user_res
[
'user_pic'
];
$table
=
new
Agents
();
$table
=
new
Agents
();
$Agents_res
=
$table
$Agents_res
=
$table
->
Agents_res
(
$v
[
'agent_id'
]);
->
where
(
'id'
,
$user_res
[
'agent_id'
])
->
field
(
'realname,phone'
)
->
find
();
$Agents_res
=
json_decode
(
json_encode
(
$Agents_res
),
true
);
//对象转数组
//dump($Agents_res);
//dump($Agents_res);
$user_res
[
'agentinfo'
]
=
$Agents_res
?
$Agents_res
[
'realname'
]
.
'/'
.
$Agents_res
[
'phone'
]
:
'未知'
;
$user_res
[
'agentinfo'
]
=
$Agents_res
?
$Agents_res
[
'realname'
]
.
'/'
.
$Agents_res
[
'phone'
]
:
'未知'
;
return
$this
->
response
(
"200"
,
"success!"
,
[
'user_info'
=>
$user_res
,
'user_date'
=>
$UPhoneFollowPp_res
,
'pagenum'
=>
$pagenum
,
'total'
=>
$total
]);
$records
=
new
GOperatingRecords
();
$records_result
=
$records
->
user_history
(
$user_id
);
//dump($records_result);
//dump($user_id);
return
$this
->
response
(
"200"
,
"success!"
,
[
'user_info'
=>
$user_res
,
'user_date'
=>
$UPhoneFollowPp_res
,
'user_history'
=>
$records_result
]);
}
else
{
}
else
{
return
$this
->
response
(
"101"
,
"失败!"
);
return
$this
->
response
(
"101"
,
"失败!"
);
}
}
...
...
application/model/Agents.php
View file @
d76aa2a4
...
@@ -167,5 +167,14 @@ class Agents extends Model
...
@@ -167,5 +167,14 @@ class Agents extends Model
{
{
return
$this
->
where
(
$params
)
->
count
();
return
$this
->
where
(
$params
)
->
count
();
}
}
public
function
Agents_res
(
$agent_id
)
{
return
db
(
'agents'
)
->
where
(
'id'
,
$agent_id
)
->
field
(
'realname,phone,head_portrait'
)
->
find
();
}
}
}
application/model/GOperatingRecords.php
View file @
d76aa2a4
...
@@ -49,4 +49,15 @@ class GOperatingRecords extends BaseModel
...
@@ -49,4 +49,15 @@ class GOperatingRecords extends BaseModel
return
$result
;
return
$result
;
}
}
public
function
user_history
(
$user_id
)
{
return
db
(
'g_operating_records'
)
->
where
(
'user_id'
,
$user_id
)
->
field
(
'name,remark,create_time'
)
->
order
(
'create_time'
,
'desc'
)
->
select
();
}
}
}
\ No newline at end of file
application/model/UPhoneFollowPp.php
View file @
d76aa2a4
...
@@ -63,4 +63,34 @@ class UPhoneFollowPp extends BaseModel
...
@@ -63,4 +63,34 @@ class UPhoneFollowPp extends BaseModel
->
where
(
$params
)
->
count
();
->
where
(
$params
)
->
count
();
return
$result
;
return
$result
;
}
}
public
function
select_useraction_search
(
$user_id
,
$searchdate
)
{
if
(
$searchdate
){
$UPhoneFollowPp_res
=
db
(
'u_phone_follow_up'
)
->
where
(
'user_id'
,
$user_id
)
->
where
(
'content'
,
$searchdate
)
->
order
(
'create_time'
,
'desc'
)
//->limit($pagesize)
//->page($pagenum)
->
select
();
/*$total =$UPhoneFollowPp
->where('user_id',$user_id)
->where('content',$searchdate)
->count();*/
}
else
{
$UPhoneFollowPp_res
=
db
(
'u_phone_follow_up'
)
->
where
(
'user_id'
,
$user_id
)
->
order
(
'create_time'
,
'desc'
)
//->limit($pagesize)
//->page($pagenum)
->
select
();
/*$total =$UPhoneFollowPp
->where('user_id',$user_id)
->count();*/
}
return
$UPhoneFollowPp_res
;
}
}
}
application/model/Users.php
View file @
d76aa2a4
...
@@ -170,6 +170,14 @@ class Users extends Model
...
@@ -170,6 +170,14 @@ class Users extends Model
return
$r
;
return
$r
;
}
}
public
function
useraction_search_user_res
(
$user_id
)
{
return
db
(
'u_users'
)
->
where
(
'id'
,
$user_id
)
->
field
(
'id as user_id,agent_id,sex,user_nick,user_pic,user_phone,create_time'
)
->
find
();
}
/*public function user_search($phone_or_name,$Two_days_ago,$user_id,$pagesize,$pagenum) {
/*public function user_search($phone_or_name,$Two_days_ago,$user_id,$pagesize,$pagenum) {
$data =$this ->where('user_nick|user_phone','like',"%$phone_or_name%")
$data =$this ->where('user_nick|user_phone','like',"%$phone_or_name%")
->where('create_time','< time',$Two_days_ago)//小于两天前,即排除48小时内受保护的客户
->where('create_time','< time',$Two_days_ago)//小于两天前,即排除48小时内受保护的客户
...
...
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