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
467b2661
Commit
467b2661
authored
Apr 18, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台客户跟进查缓存
parent
99d36ae7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
45 deletions
+41
-45
Remark.php
application/index/controller/Remark.php
+38
-28
PhoneFollowUpService.php
application/index/service/PhoneFollowUpService.php
+3
-17
No files found.
application/index/controller/Remark.php
View file @
467b2661
...
...
@@ -10,13 +10,12 @@ namespace app\index\controller;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\ClientService
;
use
app\extra\RedisExt
;
use
app\api_broker\service\VerifyRepetitionService
;
use
app\api_broker\service\RedisCacheService
;
use
app\index\extend\Basic
;
use
app\index\service\PhoneFollowUpService
;
use
app\index\service\UserLogService
;
use
app\index\service\UserService
;
use
app\model\AAgents
;
use
app\model\AAgentsPhone
;
use
app\model\ASite
;
use
app\model\GOperatingRecords
;
use
app\model\Remarks
;
...
...
@@ -56,9 +55,6 @@ class Remark extends Basic
}
}
$m_user
=
new
Users
();
$m_agent
=
new
AAgents
();
$code
=
200
;
$msg
=
''
;
...
...
@@ -78,12 +74,6 @@ class Remark extends Basic
if
(
!
empty
(
$this
->
params
[
'content'
]))
{
$where
[
'content'
]
=
$this
->
params
[
'content'
];
}
// if (!empty($this->params['remark_store_id'])) {
// $where['store_id'] = (int)$this->params['remark_store_id'];
// }
// if (!empty($this->params['remark_district_id'])) {
// $where['district_id'] = (int)$this->params['remark_district_id'];
// }
//有权限的人可以查看其它城市的跟进
if
(
!
empty
(
$this
->
params
[
'site_id'
]))
{
...
...
@@ -94,7 +84,7 @@ class Remark extends Basic
if
(
date
(
'Y-m-d'
)
==
$this
->
params
[
'start_date'
]
&&
date
(
'Y-m-d'
)
==
$this
->
params
[
'end_date'
])
{
$is_today
=
false
;
}
$result
=
[];
if
(
$site_id
==
"10001"
&&
(
$this
->
params
[
'agent_id'
]
>
0
||
!
empty
(
$this
->
params
[
"content"
]))
&&
$is_today
&&
empty
(
$this
->
params
[
'user_id'
]))
{
$searchService
=
new
SearchService
();
$this
->
params
[
'search_content'
]
=
$this
->
params
[
'content'
];
...
...
@@ -106,32 +96,38 @@ class Remark extends Basic
$if_search
=
true
;
}
else
{
$follow_up_service
=
new
PhoneFollowUpService
(
$site_id
);
$result_
data
=
$follow_up_service
->
getPhoneFollowList
(
$this
->
params
[
'start_date'
],
$this
->
params
[
'end_date'
],
$where
,
$this
->
userId
);
if
(
$result_
data
[
'code'
]
==
200
)
{
$result
=
$result_
data
[
'data'
];
$result_
list
=
$follow_up_service
->
getPhoneFollowList
(
$this
->
params
[
'start_date'
],
$this
->
params
[
'end_date'
],
$where
,
$this
->
userId
);
if
(
$result_
list
[
'code'
]
==
200
)
{
$result
=
$result_
list
[
'data'
];
}
else
{
$result
=
[];
$code
=
101
;
$msg
=
$result_data
[
'data
'
];
$msg
=
$result_list
[
'msg
'
];
}
}
if
(
$result
)
{
$redis_service
=
new
RedisCacheService
();
$s_user_service
=
new
UserService
();
$s_user_Log_service
=
new
UserLogService
();
$call
=
new
CallPhoneService
();
$label_data
=
$redis_service
->
userCallLabelCache
();
foreach
(
$result
as
$k
=>
$v
)
{
$user_data
=
$agent_data
=
[];
if
(
!
empty
(
$v
[
'user_id'
]))
{
$user_data
=
$
m_user
->
getUserById
(
'user_name,user_phone,vip,agent_id,create_time'
,
$v
[
'user_id'
]);
$user_data
=
$
redis_service
->
getRedisCache
(
1
,
$v
[
'user_id'
]);
$list
[
$k
][
'user_name'
]
=
$user_data
[
'user_name'
];
$list
[
$k
][
'user_phone'
]
=
$user_data
[
'user_phone'
];
$list
[
$k
][
'u_create_time'
]
=
$user_data
[
'create_time'
];
$list
[
$k
][
'vip'
]
=
$user_data
[
'vip'
];
$list
[
$k
][
'agent_id'
]
=
$user_data
[
'agent_id'
];
//客户客方
}
else
{
$list
[
$k
][
'user_name'
]
=
''
;
}
if
(
!
empty
(
$v
[
'agent_id'
]))
{
$agent_data
=
$redis_service
->
getRedisCache
(
2
,
$v
[
'agent_id'
]);
$list
[
$k
][
'admin'
]
=
$agent_data
[
'name'
];
}
else
{
$list
[
$k
][
'admin'
]
=
''
;
}
$list
[
$k
][
'user_phone'
]
=
substr_replace
(
$list
[
$k
][
'user_phone'
],
'****'
,
3
,
4
);
$list
[
$k
][
'admin'
]
=
$m_agent
->
getAgentsById
(
$v
[
'agent_id'
],
'name'
);
$list
[
$k
][
'label_name'
]
=
$v
[
'label_name'
];
$list
[
$k
][
'is_outstrip_twenty_four_hours'
]
=
$v
[
'is_outstrip_twenty_four_hours'
];
$list
[
$k
][
'is_outpace_call_num'
]
=
$v
[
'is_outpace_call_num'
];
$list
[
$k
][
'user_id'
]
=
$v
[
'user_id'
];
$list
[
$k
][
'content'
]
=
$v
[
'content'
];
$list
[
$k
][
'user_status'
]
=
$v
[
'user_status'
];
...
...
@@ -142,6 +138,20 @@ class Remark extends Basic
}
else
{
$list
[
$k
][
'create_time'
]
=
$v
[
'create_time'
];
}
#客户是否在保护期内(0:保护器内 1:超过保护期)
$list
[
$k
][
'is_outstrip_twenty_four_hours'
]
=
$s_user_service
->
isUserProtect
(
$v
[
'user_id'
]);
#判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定(0允许拨打 1不允许拨打)
$list
[
$k
][
'is_outpace_call_num'
]
=
$s_user_Log_service
->
userDetailIsOutpaceCallNum
(
$v
[
'user_id'
],
$user_data
[
'user_phone'
],
$this
->
userId
);
if
(
$list
[
$k
][
'is_outpace_call_num'
])
{
$result
=
$call
->
checkBindRedis
(
$this
->
userId
,
$agent_data
[
'phone_list'
],
$v
[
'user_phone'
]);
if
(
$result
!=
''
){
$list
[
$k
][
'is_outpace_call_num'
]
=
0
;
}
}
$list
[
$k
][
'label_name'
]
=
array_key_exists
(
$v
[
'labels_id'
],
$label_data
)
?
$label_data
[
$v
[
'labels_id'
]]
:
''
;
}
}
$data
[
'data'
][
'list'
]
=
$list
;
...
...
application/index/service/PhoneFollowUpService.php
View file @
467b2661
...
...
@@ -54,11 +54,11 @@ class PhoneFollowUpService
if
(
$is_bool
)
{
$msg
=
"高峰期间每10秒钟只能搜索一次(6.30-8.30)"
;
}
return
[
'code'
=>
'101'
,
'
data
'
=>
$msg
];
return
[
'code'
=>
'101'
,
'
msg
'
=>
$msg
];
}
$where
=
' 1=1 '
;
if
(
empty
(
$start_time
)
||
empty
(
$end_time
))
{
return
[
'code'
=>
'101'
,
'
data
'
=>
'时间不能为空'
];
return
[
'code'
=>
'101'
,
'
msg
'
=>
'时间不能为空'
];
}
else
{
$where
.=
' AND create_time BETWEEN "'
.
$start_time
.
' 00:00:00" AND "'
.
$end_time
.
' 23:59:59"'
;
}
...
...
@@ -89,7 +89,7 @@ class PhoneFollowUpService
$agent_id
=
$m_agent
->
getAgentsByWhereColumn
(
$agent_where
,
'id'
);
if
(
empty
(
$agent_id
))
{
return
[
'code'
=>
'101'
,
'
data
'
=>
'暂无数据'
];
return
[
'code'
=>
'101'
,
'
msg
'
=>
'暂无数据'
];
}
else
{
$agent_id_string
=
implode
(
','
,
$agent_id
);
$where
.=
" AND agent_id in (
{
$agent_id_string
}
)"
;
...
...
@@ -103,20 +103,6 @@ class PhoneFollowUpService
$data
=
$this
->
phoneFollowUp
->
getFollowList
(
$page_no
,
$page_size
,
$order_
=
''
,
$field
,
$where
);
}
$s_user_service
=
new
UserService
();
$s_user_Log_service
=
new
UserLogService
();
$m_user
=
new
Users
();
$m_label
=
new
ULabels
();
$label_data
=
$m_label
->
getColumn
(
'id,name'
,
[
'type'
=>
1
]);
//获取标签
foreach
(
$data
as
$k
=>
$v
)
{
#客户是否在保护期内(0:保护器内 1:超过保护期)
$data
[
$k
][
'is_outstrip_twenty_four_hours'
]
=
$s_user_service
->
isUserProtect
(
$v
[
'user_id'
]);
#判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定(0允许拨打 1不允许拨打)
$user_res
=
$m_user
->
getUserDetailStreamline
(
$v
[
'user_id'
],
'user_name,user_phone'
);
$data
[
$k
][
'is_outpace_call_num'
]
=
$s_user_Log_service
->
userDetailIsOutpaceCallNum
(
$v
[
'user_id'
],
$user_res
[
'user_phone'
],
$agent_id
);
$data
[
$k
][
'label_name'
]
=
array_key_exists
(
$v
[
'labels_id'
],
$label_data
)
?
$label_data
[
$v
[
'labels_id'
]]
:
''
;
}
return
[
'code'
=>
'200'
,
'data'
=>
$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