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
2f24b0ca
Commit
2f24b0ca
authored
Aug 29, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拨打电话默认跟进
parent
7c841873
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
23 deletions
+41
-23
Broker.php
application/api_broker/controller/Broker.php
+6
-0
CallPhoneService.php
application/api_broker/service/CallPhoneService.php
+29
-21
Member.php
application/index/controller/Member.php
+6
-2
No files found.
application/api_broker/controller/Broker.php
View file @
2f24b0ca
...
...
@@ -17,6 +17,7 @@ use app\api_broker\service\BrokerService;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\ClientService
;
use
app\api_broker\service\OrderLogService
;
use
app\extra\RedisExt
;
use
app\model\AAgents
;
use
app\model\ABindingDevice
;
use
app\model\ACollectUser
;
...
...
@@ -305,6 +306,11 @@ class Broker extends Basic
if
(
$result
>
0
)
{
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users
->
update_user_status
([
'id'
=>
$user_id
,
'user_status'
=>
$user_status
]);
$redis
=
RedisExt
::
getRedis
();
$user_key
=
'call_phone_user_'
.
date
(
'Y-m-d'
);
$hash_key
=
$this
->
agentId
.
'-'
.
$params
[
'user_id'
];
$redis
->
hDel
(
$user_key
,
$hash_key
);
return
$this
->
response
(
"200"
,
"success!"
,
$result
);
}
else
{
return
$this
->
response
(
"101"
,
"失败!"
);
...
...
application/api_broker/service/CallPhoneService.php
View file @
2f24b0ca
...
...
@@ -424,17 +424,17 @@ class CallPhoneService
*/
public
function
defaultFollowUp
()
{
$m_follow_up
=
new
UPhoneFollowPp
();
$m_follow_house
=
new
GHousesFollowUp
();
//
$m_follow_house = new GHousesFollowUp();
$current_time
=
time
();
$time
=
$current_time
-
3600
;
$start_date
=
date
(
'Y-m-d'
,
$time
);
$end_date
=
date
(
'Y-m-d'
);
$user_key
=
'call_phone_user_'
.
$end_date
;
$landlord_key
=
'call_phone_landlord_'
.
$end_date
;
//
$landlord_key = 'call_phone_landlord_'.$end_date;
$user_data
=
$this
->
redis
->
hKeys
(
$user_key
);
$landlord_data
=
$this
->
redis
->
hKeys
(
$landlord_key
);
//
$landlord_data = $this->redis->hKeys($landlord_key);
$content
=
'拨打电话,未打跟进。'
;
$follow_where
[
'create_time'
]
=
[
'between'
,
[
$start_date
,
$end_date
]];
...
...
@@ -460,22 +460,22 @@ class CallPhoneService
}
//房东
if
(
!
empty
(
$landlord_data
))
{
foreach
(
$landlord_data
as
$k2
=>
$v2
)
{
$call_time
=
$this
->
redis
->
hGet
(
$landlord_key
,
$v2
);
if
(
$current_time
-
$call_time
>
3600
)
{
$array
=
explode
(
'-'
,
$v2
);
$follow_where
[
'agent_id'
]
=
$array
[
0
];
$follow_where
[
'house_id'
]
=
$array
[
1
];
$is
=
$m_follow_house
->
getFollowUpByHouseId
(
$follow_where
);
if
(
!
$is
)
{
$m_follow_house
->
insertDefaultFollow
(
$array
[
0
],
$array
[
1
],
$content
,
$array
[
3
],
$array
[
2
]);
$this
->
redis
->
hDel
(
$landlord_key
,
$v2
);
}
}
}
}
//
if (!empty($landlord_data)) {
//
foreach ($landlord_data as $k2=>$v2) {
//
$call_time = $this->redis->hGet($landlord_key, $v2);
//
if ($current_time - $call_time > 3600) {
//
$array = explode('-', $v2);
//
$follow_where['agent_id'] = $array[0];
//
$follow_where['house_id'] = $array[1];
//
$is = $m_follow_house->getFollowUpByHouseId($follow_where);
//
//
if (!$is) {
//
$m_follow_house->insertDefaultFollow($array[0], $array[1], $content, $array[3], $array[2]);
//
$this->redis->hDel($landlord_key, $v2);
//
}
//
}
//
}
//
}
return
;
}
...
...
@@ -485,7 +485,9 @@ class CallPhoneService
*
* @param $agent_id
* @param $user_id
* @param $user_type
* @param $phone_a
* @param $phone_b
* @param int $user_type
*/
public
function
recordCallRedis
(
$agent_id
,
$user_id
,
$phone_a
,
$phone_b
,
$user_type
=
1
)
{
$date
=
date
(
'Y-m-d'
);
...
...
@@ -496,7 +498,12 @@ class CallPhoneService
$key
=
'call_phone_landlord_'
.
$date
;
}
$this
->
redis
->
hSet
(
$key
,
$agent_id
.
'-'
.
$user_id
.
'-'
.
$phone_a
.
'-'
.
$phone_b
,
time
());
if
(
$user_type
==
1
)
{
$this
->
redis
->
hSet
(
$key
,
$agent_id
.
'-'
.
$user_id
,
time
());
}
else
{
$this
->
redis
->
hSet
(
$key
,
$agent_id
.
'-'
.
$user_id
.
'-'
.
$phone_a
.
'-'
.
$phone_b
,
time
());
}
return
;
}
}
\ No newline at end of file
application/index/controller/Member.php
View file @
2f24b0ca
...
...
@@ -3,7 +3,7 @@
namespace
app\index\controller
;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\ClientService
;
use
app\
api_broker\service\UserExpiredTimeService
;
use
app\
extra\RedisExt
;
use
app\index\extend\Basic
;
use
app\index\service\UserService
;
use
app\model\AAgents
;
...
...
@@ -11,7 +11,6 @@ use app\model\ACollectUser;
use
app\model\GOperatingRecords
;
use
app\model\Users
;
use
app\model\UPhoneFollowPp
;
use
app\task\controller\ResultsSummaryNewTask
;
use
think\Request
;
use
think\session
;
...
...
@@ -378,6 +377,11 @@ class Member extends Basic{
$table
->
allowField
(
true
)
->
save
(
$params
);
$user
=
new
Users
();
$user
->
update_user_status
([
'id'
=>
$params
[
'user_id'
],
'user_status'
=>
$params
[
'user_status'
]]);
$redis
=
RedisExt
::
getRedis
();
$user_key
=
'call_phone_user_'
.
date
(
'Y-m-d'
);
$hash_key
=
$this
->
userId
.
'-'
.
$params
[
'user_id'
];
$redis
->
hDel
(
$user_key
,
$hash_key
);
return
$this
->
response
(
$status
,
$msg
,
$params
);
}
...
...
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