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
2c38bc2a
Commit
2c38bc2a
authored
Oct 22, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
parent
1fa7fc2b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
7 deletions
+81
-7
BatchProcessing.php
application/index/controller/BatchProcessing.php
+40
-1
Remark.php
application/index/controller/Remark.php
+13
-6
UPhoneFollowPp.php
application/model/UPhoneFollowPp.php
+27
-0
route.php
application/route.php
+1
-0
No files found.
application/index/controller/BatchProcessing.php
View file @
2c38bc2a
...
@@ -2,8 +2,10 @@
...
@@ -2,8 +2,10 @@
namespace
app\index\controller
;
namespace
app\index\controller
;
use
app\extra\RedisExt
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\model\GBusinessDistrict
;
use
app\model\GBusinessDistrict
;
use
app\model\UPhoneFollowPp
;
use
think\Log
;
use
think\Log
;
/**
/**
...
@@ -91,7 +93,44 @@ class BatchProcessing extends Basic
...
@@ -91,7 +93,44 @@ class BatchProcessing extends Basic
}
}
/**
* 设置电话跟进保护期
*/
public
function
updatePhoneFollowUpIsShow
(){
$success_num_
=
0
;
$success_num
=
0
;
$model
=
new
UPhoneFollowPp
();
$redis
=
RedisExt
::
getRedis
();
//$redis->set('set_user_save_time_1', 1, 24 * 3600);
$field
=
'id,user_id'
;
$params
=
''
;
$result
=
$model
->
getPhoneFollow
(
$field
,
$params
);
//dump($result);
foreach
(
$result
as
$k
=>
$v
)
{
$success_num_
++
;
//$is_show = 1 ;
//todo 查询redis 是否过保护期
$redis_res
=
$redis
->
get
(
'set_user_save_time_'
.
$v
[
"id"
]);
//找到返回'1' 找不到返回'false'
if
(
$redis_res
){
$success_num
++
;
$is_show
=
0
;
//todo 更新记录
$insert
=
[];
$insert
[
"id"
]
=
$v
[
"id"
];
$insert
[
"is_show"
]
=
$is_show
;
$res
=
$model
->
updatePhoneFollow
(
$insert
);
//int(1)
}
}
return
$this
->
response
(
"200"
,
"处理完成"
,[
'处理数'
=>
$success_num_
,
'修改数'
=>
$success_num
]);
}
}
}
application/index/controller/Remark.php
View file @
2c38bc2a
...
@@ -10,6 +10,7 @@ namespace app\index\controller;
...
@@ -10,6 +10,7 @@ namespace app\index\controller;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\CallPhoneService
;
use
app\api_broker\service\ClientService
;
use
app\api_broker\service\ClientService
;
use
app\extra\RedisExt
;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\index\service\UserService
;
use
app\index\service\UserService
;
use
app\model\AAgents
;
use
app\model\AAgents
;
...
@@ -119,11 +120,10 @@ class Remark extends Basic
...
@@ -119,11 +120,10 @@ class Remark extends Basic
}
}
$field
=
'id,user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id'
;
$field
=
'id,user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id'
;
$data
[
'data'
][
'list'
]
=
$u_phone_follow
->
getFollowList
(
$pageNo
,
$pageSize
,
$order_
=
'id desc'
,
$field
,
$where
);
$data
[
'data'
][
'list'
]
=
$u_phone_follow
->
getFollowList
(
$pageNo
,
$pageSize
,
$order_
=
'id desc'
,
$field
,
$where
);
$redis
=
RedisExt
::
getRedis
();
foreach
(
$data
[
'data'
][
'list'
]
as
$k
=>
$v
)
{
foreach
(
$data
[
'data'
][
'list'
]
as
$k
=>
$v
)
{
// dump($v);
//dump($v);
//查询客户是否在保护期内
//查询客户是否在保护期内
//判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期
//判断客户是否超过24小时保护期间 0:保护器内 1:超过保护期
$user_service
=
new
UserService
();
$user_service
=
new
UserService
();
...
@@ -139,11 +139,18 @@ class Remark extends Basic
...
@@ -139,11 +139,18 @@ class Remark extends Basic
}
}
$model
=
new
AAgents
();
$model
=
new
AAgents
();
$result
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$this
->
params
[
"agent_id"
]]);
$result
=
$model
->
searchAgentsByKeyword
(
"id,name,phone"
,
[
"id"
=>
$this
->
params
[
"agent_id"
]]);
$call
=
new
CallPhoneService
();
//$call = new CallPhoneService();
$result
=
$call
->
getBindNum
(
$v
[
'user_phone'
],
$result
[
0
][
'phone'
]);
//$result = $call->getBindNum($v['user_phone'],$result[0]['phone']);
if
(
$result
!=
0
){
$is_privacy
=
$redis
->
get
(
's_is_privacy'
);
//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
if
(
!
empty
(
$is_privacy
))
{
$call_key
=
'call_'
.
$this
->
userId
.
'_'
.
$result
[
0
][
'phone'
]
.
'_'
.
$v
[
'user_phone'
]
.
'_'
.
$is_privacy
;
$redis_res
=
$redis
->
get
(
$call_key
);
if
(
!
empty
(
$redis_res
)){
$is_outpace_call_num
=
0
;
$is_outpace_call_num
=
0
;
}
}
}
//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
$data
[
'data'
][
'list'
][
$k
][
'is_outpace_call_num'
]
=
$is_outpace_call_num
;
$data
[
'data'
][
'list'
][
$k
][
'is_outpace_call_num'
]
=
$is_outpace_call_num
;
/* 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定 end*/
/* 判断当天被拨打是否超过5次,同时判断是否当前经纪人跟当前客户是否有电话绑定 end*/
...
...
application/model/UPhoneFollowPp.php
View file @
2c38bc2a
...
@@ -366,4 +366,31 @@ class UPhoneFollowPp extends BaseModel
...
@@ -366,4 +366,31 @@ class UPhoneFollowPp extends BaseModel
return
$return
;
return
$return
;
}
}
/**
* 查询数据
* 朱伟 2018-10-22 14:36:06
*/
public
function
getPhoneFollow
(
$field
,
$params
)
{
$result
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
//->alias('a')
->
where
(
$params
)
->
select
();
//dump($this->getLastSql());
return
$result
;
}
/**
* 更新数据
* 朱伟 2018-10-22 14:36:06
*/
public
function
updatePhoneFollow
(
$params
)
{
$result
=
$this
->
update
(
$params
);
//dump($this->getLastSql());
return
$result
;
}
}
}
application/route.php
View file @
2c38bc2a
...
@@ -334,6 +334,7 @@ Route::group('index', [
...
@@ -334,6 +334,7 @@ Route::group('index', [
//批量处理控制器
//批量处理控制器
'getCityLatAadLng'
=>
[
'index/BatchProcessing/getCityLatAadLng'
,
[
'method'
=>
'get | post'
]
],
//批量设置商圈的经纬度
'getCityLatAadLng'
=>
[
'index/BatchProcessing/getCityLatAadLng'
,
[
'method'
=>
'get | post'
]
],
//批量设置商圈的经纬度
'updatePhoneFollowUpIsShow'
=>
[
'index/BatchProcessing/updatePhoneFollowUpIsShow'
,
[
'method'
=>
'get | post'
]
],
//批量设置商圈的经纬度
//站点相关
//站点相关
...
...
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