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
d4c8c9f8
Commit
d4c8c9f8
authored
Jan 16, 2019
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拨打电话未打跟进
parent
43e4b31c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
28 deletions
+42
-28
CallPhoneService.php
application/api_broker/service/CallPhoneService.php
+39
-28
UPhoneFollowUpTemporary.php
application/model/UPhoneFollowUpTemporary.php
+3
-0
No files found.
application/api_broker/service/CallPhoneService.php
View file @
d4c8c9f8
...
@@ -14,10 +14,12 @@ use app\api_broker\untils\RongDemo;
...
@@ -14,10 +14,12 @@ use app\api_broker\untils\RongDemo;
use
app\extra\RedisExt
;
use
app\extra\RedisExt
;
use
app\model\AliYunPhone
;
use
app\model\AliYunPhone
;
use
app\model\BindingPhone
;
use
app\model\BindingPhone
;
use
app\model\AliYunSecretReport
;
use
app\model\SecretReport
;
use
app\model\SecretReport
;
use
app\model\UPhoneFollowUp
;
use
app\model\UPhoneFollowUp
;
use
app\model\UPhoneFollowUpTemporary
;
use
app\model\UPhoneFollowUpTemporary
;
use
app\model\Users
;
use
app\model\Users
;
use
app\model\AAgents
;
use
think\Log
;
use
think\Log
;
class
CallPhoneService
class
CallPhoneService
...
@@ -540,41 +542,50 @@ class CallPhoneService
...
@@ -540,41 +542,50 @@ class CallPhoneService
*/
*/
public
function
defaultFollowUp
()
public
function
defaultFollowUp
()
{
{
$secret_model
=
new
AliYunSecretReport
();
/*$current_time = time();
$agent_model
=
new
AAgents
();
$time = $current_time - 3600;
$current_time
=
time
();
// $start_date = date('Y-m-d', $time);
$end_time
=
$current_time
-
3600
;
$end_date = date('Y-m-d');
$start_time
=
$end_time
-
3600
;
$user_key = 'call_phone_user_' . $end_date;
$user_data = $this->redis->hKeys($user_key);
$save_follow
[
'content'
]
=
'拨打电话,未打跟进。'
;
$content = '拨打电话,未打跟进。';
$follow_where
[
'create_time'
]
=
$bind_where
[
'create_time'
]
=
[
$follow_where['create_time'] = ['between', [date('Y-m-d H:i:s', $time), date('Y-m-d H:i:s')]];
'between'
,
[
date
(
'Y-m-d H:i:s'
,
$start_time
),
date
(
'Y-m-d H:i:s'
,
$end_time
)]
];
$bind_where
[
'time'
]
=
[
'>'
,
0
];
$num
=
$secret_model
->
getTotal
(
$bind_where
);
//用户
//用户
if (!empty($user_data)) {
if
(
$num
>
0
)
{
for
(
$i
=
1
;
$i
<=
$num
;
$i
++
)
{
$secret_data
=
$secret_model
->
getList
(
$i
,
500
,
''
,
'agents_id,users_id,create_time'
,
$bind_where
);
foreach
(
$secret_data
as
$key
=>
$value
)
{
if
(
empty
(
$value
[
'agents_id'
])
||
empty
(
$value
[
'users_id'
]))
{
continue
;
}
foreach ($user_data as $k => $v) {
$site_id
=
$agent_model
->
getAgentsById
(
$value
[
'agents_id'
],
'site_id'
);
$call_time = $this->redis->hGet($user_key, $v);
if
(
empty
(
$site_id
))
{
continue
;
}
if ($current_time - $call_time > 3600) {
$follow_model
=
new
UPhoneFollowUpTemporary
(
$site_id
);
$array = explode('-', $v);
$follow_where
[
'user_id'
]
=
$value
[
'users_id'
];
$follow_where['agent_id'] = $array[0];
$follow_where
[
'agent_id'
]
=
$value
[
'agents_id'
];
$follow_where['user_id'] = $array[1];
$count
=
$follow_model
->
getFollowTotal
(
$follow_where
);
if(empty($array[2])){
$this->redis->hDel($user_key, $v);
if
(
empty
(
$count
))
{
} else {
$save_follow
[
'user_id'
]
=
$value
[
'users_id'
];
$m_follow_up = new UPhoneFollowUpTemporary($array[2]);
$save_follow
[
'agent_id'
]
=
$value
[
'agents_id'
];
$num = $m_follow_up->getFollowTotal($follow_where);
$save_follow
[
'user_status'
]
=
-
1
;
if (empty($num) && !empty($array[1])) {
$save_follow
[
'type'
]
=
0
;
//$agent_id, $user_id, $content, $type
$save_follow
[
'labels_id'
]
=
0
;
$m_follow_up->insertDefaultFollow($array[0], $array[1], $content, 0);
$save_follow
[
'create_time'
]
=
$value
[
'create_time'
];
$this->redis->hDel($user_key, $v);
$follow_model
->
savePhoneFollow
(
$save_follow
);
}
}
}
}
}
}
}
}
}
return;
*/
return
;
}
}
/**
/**
...
...
application/model/UPhoneFollowUpTemporary.php
View file @
d4c8c9f8
...
@@ -63,6 +63,9 @@ class UPhoneFollowUpTemporary extends BaseModel
...
@@ -63,6 +63,9 @@ class UPhoneFollowUpTemporary extends BaseModel
if
(
isset
(
$params
[
"user_status"
]))
{
if
(
isset
(
$params
[
"user_status"
]))
{
$arr
[
"user_status"
]
=
$params
[
"user_status"
];
$arr
[
"user_status"
]
=
$params
[
"user_status"
];
}
}
if
(
isset
(
$params
[
'create_time'
]))
{
$arr
[
"create_time"
]
=
$params
[
"create_time"
];
}
if
(
isset
(
$this
->
siteId
))
{
if
(
isset
(
$this
->
siteId
))
{
switch
(
$this
->
siteId
)
{
switch
(
$this
->
siteId
)
{
...
...
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