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
f5c2b11c
Commit
f5c2b11c
authored
Sep 17, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
经纪人查看客户日志
parent
08f1bfa7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
316 additions
and
135 deletions
+316
-135
AgentLookUserLogService.php
application/api_broker/service/AgentLookUserLogService.php
+69
-0
UserLogService.php
application/index/service/UserLogService.php
+104
-134
TLookAgentUserModel.php
application/model/TLookAgentUserModel.php
+12
-1
SaveLookUserHistoryTask.php
application/task/controller/SaveLookUserHistoryTask.php
+131
-0
No files found.
application/api_broker/service/AgentLookUserLogService.php
0 → 100644
View file @
f5c2b11c
<?php
namespace
app\api_broker\service
;
use
app\extra\RedisExt
;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/9/17
* Time: 10:28
*/
class
AgentLookUserLogService
{
private
$redis
;
private
$nowTime
;
const
LOOK_USER
=
"agent_look_user_"
;
//经纪人看用户key
const
IS_PC
=
"agent_look_user_by_pc"
;
//记录是哪里看的
public
function
__construct
()
{
$this
->
redis
=
RedisExt
::
getRedis
();
$this
->
nowTime
=
date
(
"Y-m-d"
,
time
());
}
/**
* @param int $agent_id
* @param int $user_id
* @param int $is_pc
* @return array
*/
public
function
saveCacheAgentLookUser
(
int
$agent_id
,
int
$user_id
,
int
$is_pc
)
:
array
{
//redis服务挂掉,都可以看
if
(
!
$this
->
redis
)
{
return
;
}
//判断此用户是否看过
$isExist
=
$this
->
isLooked
(
$agent_id
,
$user_id
);
if
(
!
$isExist
)
{
$this
->
redis
->
sAdd
(
self
::
LOOK_USER
.
$this
->
nowTime
.
$agent_id
,
$user_id
);
//存入所看用户信息
$this
->
redis
->
set
(
self
::
LOOK_USER
.
$this
->
nowTime
.
$agent_id
.
"_"
.
$user_id
,
time
());
//存入第一次看的时间
$this
->
redis
->
set
(
self
::
IS_PC
.
$this
->
nowTime
.
$agent_id
.
"_"
.
$user_id
,
$is_pc
);
}
else
{
$this
->
redis
->
set
(
self
::
LOOK_USER
.
$this
->
nowTime
.
$agent_id
.
"_"
.
$user_id
.
"_lastTime"
,
time
());
//存入最后一次看的时间
$this
->
redis
->
set
(
self
::
IS_PC
.
$this
->
nowTime
.
$agent_id
.
"_"
.
$user_id
.
"_lastTime"
,
$is_pc
);
}
return
;
}
/**
* 判断是否已经看过,看过返回true 否则 false
* @param int $agent_id
* @param int $user_id
* @return bool
*/
public
function
isLooked
(
int
$agent_id
,
int
$user_id
)
:
bool
{
$isExist
=
$this
->
redis
->
sIsMember
(
self
::
LOOK_USER
.
$this
->
nowTime
.
$agent_id
,
$user_id
);
if
(
$isExist
)
{
return
true
;
}
else
{
return
false
;
}
}
}
\ No newline at end of file
application/index/service/UserLogService.php
View file @
f5c2b11c
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\index\service
;
namespace
app\index\service
;
use
app\api_broker\service\AgentLookUserLogService
;
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\api_broker\service\OrderLogService
;
use
app\api_broker\service\OrderLogService
;
...
@@ -37,8 +38,8 @@ class UserLogService
...
@@ -37,8 +38,8 @@ class UserLogService
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
agentModel
=
new
AAgents
();
$this
->
agentModel
=
new
AAgents
();
$this
->
userModel
=
new
Users
();
$this
->
userModel
=
new
Users
();
$this
->
orderService
=
new
OrderLogService
();
$this
->
orderService
=
new
OrderLogService
();
}
}
...
@@ -74,19 +75,19 @@ class UserLogService
...
@@ -74,19 +75,19 @@ class UserLogService
}
}
$user_arr
[
'user_pic'
]
=
HEADERIMGURL
.
$user_arr
[
'user_pic'
];
$user_arr
[
'user_pic'
]
=
HEADERIMGURL
.
$user_arr
[
'user_pic'
];
$agents_arr
=
$m_user_agent
->
getUserAgent
(
'a.agent_id,c.name,c.phone'
,
[
'a.site_id'
=>
$site_id
,
'a.user_id'
=>
$user_id
]);
$agents_arr
=
$m_user_agent
->
getUserAgent
(
'a.agent_id,c.name,c.phone'
,
[
'a.site_id'
=>
$site_id
,
'a.user_id'
=>
$user_id
]);
if
(
$agents_arr
[
'name'
])
{
if
(
$agents_arr
[
'name'
])
{
$user_arr
[
'agent_info'
]
=
$agents_arr
?
$agents_arr
[
'name'
]
.
'-'
.
$agents_arr
[
'phone'
]
:
'未知'
;
$user_arr
[
'agent_info'
]
=
$agents_arr
?
$agents_arr
[
'name'
]
.
'-'
.
$agents_arr
[
'phone'
]
:
'未知'
;
$user_arr
[
'agent_id'
]
=
$agents_arr
[
'agent_id'
];
$user_arr
[
'agent_id'
]
=
$agents_arr
[
'agent_id'
];
}
else
{
}
else
{
$user_arr
[
'agent_info'
]
=
''
;
$user_arr
[
'agent_info'
]
=
''
;
}
}
$data
[
'agent_path'
]
=
AGENTHEADERIMGURL
;
$data
[
'agent_path'
]
=
AGENTHEADERIMGURL
;
$user_arr
[
'user_phone'
]
=
substr_replace
(
$user_arr
[
'user_phone'
],
'****'
,
3
,
4
);
$user_arr
[
'user_phone'
]
=
substr_replace
(
$user_arr
[
'user_phone'
],
'****'
,
3
,
4
);
if
(
$user_arr
[
'referrer_source'
]
==
0
&&
$user_arr
[
'referrer_id'
]
==
0
)
{
if
(
$user_arr
[
'referrer_source'
]
==
0
&&
$user_arr
[
'referrer_id'
]
==
0
)
{
$user_arr
[
'referrer_id'
]
=
''
;
$user_arr
[
'referrer_id'
]
=
''
;
$user_arr
[
'referrer_user'
]
=
''
;
$user_arr
[
'referrer_user'
]
=
''
;
$user_arr
[
'referrer_source'
]
=
''
;
$user_arr
[
'referrer_source'
]
=
''
;
}
}
#客户详情
#客户详情
...
@@ -96,7 +97,7 @@ class UserLogService
...
@@ -96,7 +97,7 @@ class UserLogService
$data
[
"user_history_log"
]
=
$this
->
userHistoryLog
(
$user_id
);
$data
[
"user_history_log"
]
=
$this
->
userHistoryLog
(
$user_id
);
#是否被收藏
#是否被收藏
$data
[
"is_collect"
]
=
$this
->
userDetailIsCollect
(
$user_id
,
$agent_id
);
$data
[
"is_collect"
]
=
$this
->
userDetailIsCollect
(
$user_id
,
$agent_id
);
#保护期(0:保护器内 1:超过保护期)
#保护期(0:保护器内 1:超过保护期)
$data
[
'is_outstrip_twenty_four_hours'
]
=
$user_service
->
isUserProtect
(
$user_id
);
$data
[
'is_outstrip_twenty_four_hours'
]
=
$user_service
->
isUserProtect
(
$user_id
);
...
@@ -118,15 +119,15 @@ class UserLogService
...
@@ -118,15 +119,15 @@ class UserLogService
$data
[
'site_ids_name_new'
]
=
$data
[
'site_ids_name'
];
$data
[
'site_ids_name_new'
]
=
$data
[
'site_ids_name'
];
#拨打电话按钮是否显示 0:显示 1:不显示
#拨打电话按钮是否显示 0:显示 1:不显示
$data
[
'is_phone_button_show'
]
=
$this
->
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$user_arr
[
'vip'
],
$user_arr
[
'user_phone'
],
$user_arr
[
'agent_id'
]);
$data
[
'is_phone_button_show'
]
=
$this
->
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$user_arr
[
'vip'
],
$user_arr
[
'user_phone'
],
$user_arr
[
'agent_id'
]);
//客方
//客方
$s_user_agent
=
new
UserAgentService
();
$s_user_agent
=
new
UserAgentService
();
$user_agent_res
=
$s_user_agent
->
selectUserAgent
(
$user_id
);
$user_agent_res
=
$s_user_agent
->
selectUserAgent
(
$user_id
);
$data
[
'customer_relegation_list'
]
=
$user_agent_res
?
$user_agent_res
:
[];
$data
[
'customer_relegation_list'
]
=
$user_agent_res
?
$user_agent_res
:
[];
$agentLookUserService
=
new
AgentLookUserLogService
();
// $this->agentLookUser($user_id, $agent
_id, 1); //记录经纪人看客户
$agentLookUserService
->
saveCacheAgentLookUser
(
$agent_id
,
$user
_id
,
1
);
//记录经纪人看客户
return
[
"code"
=>
200
,
"data"
=>
$data
];
return
[
"code"
=>
200
,
"data"
=>
$data
];
}
}
...
@@ -134,20 +135,21 @@ class UserLogService
...
@@ -134,20 +135,21 @@ class UserLogService
* @param $user_id
* @param $user_id
* @return mixed
* @return mixed
*/
*/
public
function
userHistoryLog
(
$user_id
){
public
function
userHistoryLog
(
$user_id
)
{
#客方、邀请人修改日志 点击客户'编辑'按钮显示
#客方、邀请人修改日志 点击客户'编辑'按钮显示
#客户姓名、城市标签修改记录 由专门的'修改记录'按钮显示
#客户姓名、城市标签修改记录 由专门的'修改记录'按钮显示
$m_records
=
new
GOperatingRecords
();
$m_records
=
new
GOperatingRecords
();
//客方修改日志
//客方修改日志
$param_
[
'user_id'
]
=
$user_id
;
$param_
[
'user_id'
]
=
$user_id
;
$param_
[
'type'
]
=
3
;
$param_
[
'type'
]
=
3
;
$result
[
'agent_history'
]
=
$m_records
->
user_history
(
$param_
);
$result
[
'agent_history'
]
=
$m_records
->
user_history
(
$param_
);
//邀请人修改日志
//邀请人修改日志
$param_
[
'type'
]
=
5
;
$param_
[
'type'
]
=
5
;
$result
[
'invite_history'
]
=
$m_records
->
user_history
(
$param_
);
$result
[
'invite_history'
]
=
$m_records
->
user_history
(
$param_
);
//客户姓名 城市标签 修改记录
//客户姓名 城市标签 修改记录
$param_
[
'type'
]
=
array
(
'in'
,
'9,10'
);
$param_
[
'type'
]
=
array
(
'in'
,
'9,10'
);
$result
[
'other_history'
]
=
$m_records
->
user_history
(
$param_
);
$result
[
'other_history'
]
=
$m_records
->
user_history
(
$param_
);
return
$result
;
return
$result
;
}
}
...
@@ -166,11 +168,11 @@ class UserLogService
...
@@ -166,11 +168,11 @@ class UserLogService
public
function
userLog
(
$user_id
,
$site_id
,
$type
)
public
function
userLog
(
$user_id
,
$site_id
,
$type
)
{
{
$result
=
$this
->
orderService
->
selectListByUserIdAndSiteId
(
$user_id
,
''
,
$site_id
);
$result
=
$this
->
orderService
->
selectListByUserIdAndSiteId
(
$user_id
,
''
,
$site_id
);
switch
(
$type
){
switch
(
$type
)
{
case
1
:
case
1
:
if
(
count
(
$result
)
>
0
)
{
if
(
count
(
$result
)
>
0
)
{
return
$result
[
0
];
return
$result
[
0
];
}
else
{
}
else
{
return
null
;
return
null
;
}
}
...
@@ -195,8 +197,8 @@ class UserLogService
...
@@ -195,8 +197,8 @@ class UserLogService
public
function
phoneFollowUpNew
(
$user_id
,
$site_id
,
$page_no
,
$page_size
)
public
function
phoneFollowUpNew
(
$user_id
,
$site_id
,
$page_no
,
$page_size
)
{
{
// $userParams["type"] = 0; //电话跟进 $userParams["type"] = 1; //普通跟进
// $userParams["type"] = 0; //电话跟进 $userParams["type"] = 1; //普通跟进
$m_label
=
new
ULabels
();
$m_label
=
new
ULabels
();
$label_data
=
$m_label
->
getColumn
(
'id,name'
,
[
'type'
=>
1
]);
//获取标签
$label_data
=
$m_label
->
getColumn
(
'id,name'
,
[
'type'
=>
1
]);
//获取标签
$uPhoneFollowTempModel
=
new
UPhoneFollowUpTemporary
(
$site_id
);
$uPhoneFollowTempModel
=
new
UPhoneFollowUpTemporary
(
$site_id
);
//电话跟进
//电话跟进
...
@@ -204,10 +206,10 @@ class UserLogService
...
@@ -204,10 +206,10 @@ class UserLogService
$field_user_follow
=
"a.id,a.labels_id,a.content,a.user_id,a.agent_id,a.type,a.create_time,a.user_status,b.name,b.phone,b.img,a.img_str"
;
$field_user_follow
=
"a.id,a.labels_id,a.content,a.user_id,a.agent_id,a.type,a.create_time,a.user_status,b.name,b.phone,b.img,a.img_str"
;
$bargainData
=
$uPhoneFollowTempModel
->
getFollowUpList
(
$field_user_follow
,
$userParams
,
$page_no
,
$page_size
);
$bargainData
=
$uPhoneFollowTempModel
->
getFollowUpList
(
$field_user_follow
,
$userParams
,
$page_no
,
$page_size
);
foreach
(
$bargainData
as
$k
=>
$v
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
$bargainData
[
$k
][
'label_name'
]
=
array_key_exists
(
$v
[
'labels_id'
],
$label_data
)
?
'【'
.
$label_data
[
$v
[
'labels_id'
]]
.
'】'
:
''
;
$bargainData
[
$k
][
'label_name'
]
=
array_key_exists
(
$v
[
'labels_id'
],
$label_data
)
?
'【'
.
$label_data
[
$v
[
'labels_id'
]]
.
'】'
:
''
;
}
}
return
$bargainData
;
return
$bargainData
;
...
@@ -216,17 +218,17 @@ class UserLogService
...
@@ -216,17 +218,17 @@ class UserLogService
public
function
phoneFollowUp
(
$user_id
,
$site_id
,
$page_no
,
$page_size
)
public
function
phoneFollowUp
(
$user_id
,
$site_id
,
$page_no
,
$page_size
)
{
{
// $userParams["type"] = 0; //电话跟进 $userParams["type"] = 1; //普通跟进
// $userParams["type"] = 0; //电话跟进 $userParams["type"] = 1; //普通跟进
$m_label
=
new
ULabels
();
$m_label
=
new
ULabels
();
$label_data
=
$m_label
->
getColumn
(
'id,name'
,
[
'type'
=>
1
]);
//获取标签
$label_data
=
$m_label
->
getColumn
(
'id,name'
,
[
'type'
=>
1
]);
//获取标签
$uPhoneFollowModel
=
new
UPhoneFollowUp
(
$site_id
);
$uPhoneFollowModel
=
new
UPhoneFollowUp
(
$site_id
);
//电话跟进
//电话跟进
$userParams
[
"user_id"
]
=
$user_id
;
$userParams
[
"user_id"
]
=
$user_id
;
$field_user_follow
=
"a.id,a.labels_id,a.content,a.user_id,a.agent_id,a.type,a.create_time,a.user_status,b.name,b.phone,b.img,a.img_str"
;
$field_user_follow
=
"a.id,a.labels_id,a.content,a.user_id,a.agent_id,a.type,a.create_time,a.user_status,b.name,b.phone,b.img,a.img_str"
;
$bargainData
=
$uPhoneFollowModel
->
getFollowUpList
(
$field_user_follow
,
$userParams
,
$page_no
,
$page_size
);
$bargainData
=
$uPhoneFollowModel
->
getFollowUpList
(
$field_user_follow
,
$userParams
,
$page_no
,
$page_size
);
foreach
(
$bargainData
as
$k
=>
$v
)
{
foreach
(
$bargainData
as
$k
=>
$v
)
{
$bargainData
[
$k
][
'label_name'
]
=
array_key_exists
(
$v
[
'labels_id'
],
$label_data
)
?
'【'
.
$label_data
[
$v
[
'labels_id'
]]
.
'】'
:
''
;
$bargainData
[
$k
][
'label_name'
]
=
array_key_exists
(
$v
[
'labels_id'
],
$label_data
)
?
'【'
.
$label_data
[
$v
[
'labels_id'
]]
.
'】'
:
''
;
}
}
return
$bargainData
;
return
$bargainData
;
}
}
...
@@ -238,49 +240,50 @@ class UserLogService
...
@@ -238,49 +240,50 @@ class UserLogService
* @param $agent_id
* @param $agent_id
* @return mixed
* @return mixed
*/
*/
public
function
userDetailStreamline
(
$user_id
,
$agent_id
,
$site_id
)
public
function
userDetailStreamline
(
$user_id
,
$agent_id
,
$site_id
)
{
{
//查询客户详情
//查询客户详情
$field
=
'id as user_id,sex,user_pic,other_pic,user_nick,user_name,user_phone,site_ids,agent_id,user_label,
$field
=
'id as user_id,sex,user_pic,other_pic,user_nick,user_name,user_phone,site_ids,agent_id,user_label,
industry_type,price_demand,area_demand,vip,user_status,entrust_type,concrete_industry'
;
industry_type,price_demand,area_demand,vip,user_status,entrust_type,concrete_industry'
;
$result
=
$this
->
userModel
->
getUserDetailStreamline
(
$user_id
,
$field
);
$result
=
$this
->
userModel
->
getUserDetailStreamline
(
$user_id
,
$field
);
if
(
count
(
$result
)
<=
0
)
{
if
(
count
(
$result
)
<=
0
)
{
return
[
"code"
=>
101
,
"msg"
=>
"没找到此条用户信息"
];
return
[
"code"
=>
101
,
"msg"
=>
"没找到此条用户信息"
];
}
}
$result
[
'user_name'
]
=
$result
[
'user_name'
]
&&
$result
[
'entrust_type'
]
==
0
?
"
{
$result
[
'concrete_industry'
]
}
,
{
$result
[
'user_name'
]
}
"
:
$result
[
'user_name'
];
$result
[
'user_name'
]
=
$result
[
'user_name'
]
&&
$result
[
'entrust_type'
]
==
0
?
"
{
$result
[
'concrete_industry'
]
}
,
{
$result
[
'user_name'
]
}
"
:
$result
[
'user_name'
];
$result
[
'user_pic'
]
=
!
empty
(
$result
[
"user_pic"
])
?
HEADERIMGURL
.
$result
[
"user_pic"
]
:
$result
[
"other_pic"
];
$result
[
'user_pic'
]
=
!
empty
(
$result
[
"user_pic"
])
?
HEADERIMGURL
.
$result
[
"user_pic"
]
:
$result
[
"other_pic"
];
#判断是否纯房东 0:否 1:是
#判断是否纯房东 0:否 1:是
$result
[
'is_single_homeowner'
]
=
$result
[
'user_label'
]
==
2
?
1
:
0
;
$result
[
'is_single_homeowner'
]
=
$result
[
'user_label'
]
==
2
?
1
:
0
;
#客户站点(旧 兼容老版本)
#客户站点(旧 兼容老版本)
$s_index_user
=
new
UserService
();
$s_index_user
=
new
UserService
();
$result
[
'site_ids_name'
]
=
$s_index_user
->
userSiteName
(
$result
[
"site_ids"
]);
$result
[
'site_ids_name'
]
=
$s_index_user
->
userSiteName
(
$result
[
"site_ids"
]);
#客户站点 新(客户站点独立建表)
#客户站点 新(客户站点独立建表)
// $s_user_site = new UserSiteService();
// $s_user_site = new UserSiteService();
$result
[
'site_ids_name_new'
]
=
$result
[
'site_ids_name'
]
;
$result
[
'site_ids_name_new'
]
=
$result
[
'site_ids_name'
];
#是否被收藏
#是否被收藏
$result
[
"is_collect"
]
=
$this
->
userDetailIsCollect
(
$user_id
,
$agent_id
);
$result
[
"is_collect"
]
=
$this
->
userDetailIsCollect
(
$user_id
,
$agent_id
);
#客户是否在保护期内(0:保护器内 1:超过保护期)
#客户是否在保护期内(0:保护器内 1:超过保护期)
$user_service
=
new
UserService
();
$user_service
=
new
UserService
();
$result
[
"is_outstrip_twenty_four_hours"
]
=
$user_service
->
isUserProtect
(
$user_id
);
$result
[
"is_outstrip_twenty_four_hours"
]
=
$user_service
->
isUserProtect
(
$user_id
);
#有约带看的客户显示 '约带看'标签 0:不显示 1:显示
#有约带看的客户显示 '约带看'标签 0:不显示 1:显示
$s_user_call
=
new
UserCallStintService
();
$s_user_call
=
new
UserCallStintService
();
$is_user_report
=
$s_user_call
->
isUserReport
(
$user_id
);
$is_user_report
=
$s_user_call
->
isUserReport
(
$user_id
);
$result
[
'is_user_report'
]
=
$is_user_report
;
$result
[
'is_user_report'
]
=
$is_user_report
;
#拨打电话按钮是否显示 0:显示 1:不显示
#拨打电话按钮是否显示 0:显示 1:不显示
$result
[
'is_phone_button_show'
]
=
$this
->
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$result
[
'vip'
],
$result
[
'user_phone'
],
$result
[
'agent_id'
]);
$result
[
'is_phone_button_show'
]
=
$this
->
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$result
[
'vip'
],
$result
[
'user_phone'
],
$result
[
'agent_id'
]);
#编辑客户详情权限 0:有权限 1:无权限
#编辑客户详情权限 0:有权限 1:无权限
$result
[
'is_can_edit_user_info'
]
=
$user_service
->
isCanEditUserInfo
(
$result
[
"agent_id"
],
$agent_id
,
$user_id
);
$result
[
'is_can_edit_user_info'
]
=
$user_service
->
isCanEditUserInfo
(
$result
[
"agent_id"
],
$agent_id
,
$user_id
);
//$this->agentLookUser($user_id, $agent_id, 0); //记录经纪人看客户
$agentLookUserService
=
new
AgentLookUserLogService
();
$agentLookUserService
->
saveCacheAgentLookUser
(
$agent_id
,
$user_id
,
0
);
//记录经纪人看客户
return
$result
;
return
$result
;
...
@@ -294,30 +297,30 @@ class UserLogService
...
@@ -294,30 +297,30 @@ class UserLogService
public
function
userDetailFull
(
$user_id
)
public
function
userDetailFull
(
$user_id
)
{
{
//查询客户详情
//查询客户详情
$field
=
'id as user_id,agent_id,vip,create_time,first_login_time,referrer_source,referrer_id,registration_time,
$field
=
'id as user_id,agent_id,vip,create_time,first_login_time,referrer_source,referrer_id,registration_time,
source_intro,referrer_source,source,entrust_type,concrete_industry,weixin_nick'
;
source_intro,referrer_source,source,entrust_type,concrete_industry,weixin_nick'
;
$user_result
=
$this
->
userModel
->
getUserDetailStreamline
(
$user_id
,
$field
);
$user_result
=
$this
->
userModel
->
getUserDetailStreamline
(
$user_id
,
$field
);
if
(
count
(
$user_result
)
<=
0
)
{
if
(
count
(
$user_result
)
<=
0
)
{
return
[
"code"
=>
101
,
"msg"
=>
"没找到此条用户信息"
];
return
[
"code"
=>
101
,
"msg"
=>
"没找到此条用户信息"
];
}
}
// 客方 姓名+手机号
// 客方 姓名+手机号
$agents_res
=
$this
->
agentModel
->
verifyUser
(
'name,phone'
,
''
,
[
'id'
=>
$user_result
[
'agent_id'
]
]);
$agents_res
=
$this
->
agentModel
->
verifyUser
(
'name,phone'
,
''
,
[
'id'
=>
$user_result
[
'agent_id'
]
]);
$result
[
'agent_name'
]
=
$agents_res
[
'name'
]
?
$agents_res
[
'name'
]
:
'未知'
;
$result
[
'agent_name'
]
=
$agents_res
[
'name'
]
?
$agents_res
[
'name'
]
:
'未知'
;
$result
[
'agent_phone'
]
=
$agents_res
[
'phone'
]
?
$agents_res
[
'phone'
]
:
'未知'
;
$result
[
'agent_phone'
]
=
$agents_res
[
'phone'
]
?
$agents_res
[
'phone'
]
:
'未知'
;
//客方
//客方
$s_user_agent
=
new
UserAgentService
();
$s_user_agent
=
new
UserAgentService
();
$user_agent_res
=
$s_user_agent
->
selectUserAgent
(
$user_id
);
$user_agent_res
=
$s_user_agent
->
selectUserAgent
(
$user_id
);
$result
[
'customer_relegation_list'
]
=
$user_agent_res
?
$user_agent_res
:
null
;
$result
[
'customer_relegation_list'
]
=
$user_agent_res
?
$user_agent_res
:
null
;
// 是否转介绍
// 是否转介绍
$result
[
'referrer_source'
]
=
$user_result
[
'referrer_source'
];
$result
[
'referrer_source'
]
=
$user_result
[
'referrer_source'
];
// 邀请人 手机号 ID
// 邀请人 手机号 ID
$invite_info
=
$this
->
userDetailUserInvite
(
$user_result
[
'referrer_id'
],
$user_result
[
'referrer_source'
]);
$invite_info
=
$this
->
userDetailUserInvite
(
$user_result
[
'referrer_id'
],
$user_result
[
'referrer_source'
]);
$result
[
'user_inviter_phone'
]
=
$invite_info
[
'invite_phone'
];
$result
[
'user_inviter_phone'
]
=
$invite_info
[
'invite_phone'
];
$result
[
'user_inviter_id'
]
=
$invite_info
[
'invite_id'
];
$result
[
'user_inviter_id'
]
=
$invite_info
[
'invite_id'
];
// vip客户
// vip客户
$result
[
'vip'
]
=
$user_result
[
'vip'
];
$result
[
'vip'
]
=
$user_result
[
'vip'
];
...
@@ -330,9 +333,9 @@ class UserLogService
...
@@ -330,9 +333,9 @@ class UserLogService
// 下载登录时间
// 下载登录时间
$result
[
'first_login_time'
]
=
$user_result
[
'first_login_time'
];
$result
[
'first_login_time'
]
=
$user_result
[
'first_login_time'
];
// 客户来源
// 客户来源
$result
[
'source_intro'
]
=
$user_result
[
'source_intro'
];
$result
[
'source_intro'
]
=
$user_result
[
'source_intro'
];
$result
[
'concrete_industry'
]
=
$user_result
[
'concrete_industry'
];
$result
[
'concrete_industry'
]
=
$user_result
[
'concrete_industry'
];
$result
[
'weixin_nick'
]
=
$user_result
[
'weixin_nick'
];
$result
[
'weixin_nick'
]
=
$user_result
[
'weixin_nick'
];
return
$result
;
return
$result
;
}
}
...
@@ -346,15 +349,15 @@ class UserLogService
...
@@ -346,15 +349,15 @@ class UserLogService
* @param $result_agent_id
* @param $result_agent_id
* @return int
* @return int
*/
*/
public
function
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$is_vip
,
$result_user_phone
,
$result_agent_id
)
public
function
isPhoneButtonShow
(
$user_id
,
$agent_id
,
$is_vip
,
$result_user_phone
,
$result_agent_id
)
{
{
$user_service
=
new
UserService
();
$user_service
=
new
UserService
();
$vip_services
=
new
VipService
();
$vip_services
=
new
VipService
();
$s_user_agent
=
new
UserAgentService
();
$s_user_agent
=
new
UserAgentService
();
$user_agent_list
=
$s_user_agent
->
getUserAgentId
(
$user_id
);
$user_agent_list
=
$s_user_agent
->
getUserAgentId
(
$user_id
);
if
(
$user_agent_list
)
{
if
(
$user_agent_list
)
{
$is_user_agent_boss
=
1
;
$is_user_agent_boss
=
1
;
$called
=
1
;
$called
=
1
;
$user_agent_list_arr
=
[];
$user_agent_list_arr
=
[];
foreach
(
$user_agent_list
as
$key
=>
$value
)
{
foreach
(
$user_agent_list
as
$key
=>
$value
)
{
$user_agent_list_arr
[]
=
$value
[
'agent_id'
];
$user_agent_list_arr
[]
=
$value
[
'agent_id'
];
...
@@ -390,28 +393,28 @@ class UserLogService
...
@@ -390,28 +393,28 @@ class UserLogService
$examine_vip
=
$vip_services
->
vip
(
$agent_id
);
$examine_vip
=
$vip_services
->
vip
(
$agent_id
);
#经纪人客户是否有约带看 0:可查看 1:不可查看
#经纪人客户是否有约带看 0:可查看 1:不可查看
$is_report
=
$user_service
->
isReport
(
$agent_id
,
$user_id
);
$is_report
=
$user_service
->
isReport
(
$agent_id
,
$user_id
);
#当天有约带看的客户 0:不显示 1:显示
#当天有约带看的客户 0:不显示 1:显示
$s_user_call
=
new
UserCallStintService
();
$s_user_call
=
new
UserCallStintService
();
$is_user_report
=
$s_user_call
->
isUserReport
(
$user_id
);
$is_user_report
=
$s_user_call
->
isUserReport
(
$user_id
);
//3.3.9 如果有约带看 同时过保护期了
//3.3.9 如果有约带看 同时过保护期了
if
(
$is_user_report
==
1
and
(
$is_outstrip_twenty_four_hours
==
1
))
{
if
(
$is_user_report
==
1
and
(
$is_outstrip_twenty_four_hours
==
1
))
{
$s_user_call
=
new
UserCallStintService
();
$s_user_call
=
new
UserCallStintService
();
$report_agents
=
$s_user_call
->
getUserReportAgentIdList
(
$user_id
);
$report_agents
=
$s_user_call
->
getUserReportAgentIdList
(
$user_id
);
//3.3.9 有约带看订单的客户 预计到场当天 只能 约带看提交人 或 客方 拨打电话
//3.3.9 有约带看订单的客户 预计到场当天 只能 约带看提交人 或 客方 拨打电话
if
((
$result_agent_id
==
$agent_id
)
or
(
in_array
(
$agent_id
,
$report_agents
)))
{
if
((
$result_agent_id
==
$agent_id
)
or
(
in_array
(
$agent_id
,
$report_agents
)))
{
return
0
;
return
0
;
}
else
{
}
else
{
return
1
;
return
1
;
}
}
}
}
#当天有约带看的客户 0:不显示 1:显示
#当天有约带看的客户 0:不显示 1:显示
$result_val
=
1
;
$result_val
=
1
;
if
(
if
(
((
$is_outpace_call_num
==
0
)
and
(
$is_outstrip_twenty_four_hours
==
1
)
and
(
$is_vip
!=
1
)
)
//过保护期
((
$is_outpace_call_num
==
0
)
and
(
$is_outstrip_twenty_four_hours
==
1
)
and
(
$is_vip
!=
1
)
)
//过保护期
OR
OR
(
$is_user_agent_boss
==
0
)
//总监可以看
(
$is_user_agent_boss
==
0
)
//总监可以看
OR
OR
...
@@ -419,17 +422,17 @@ class UserLogService
...
@@ -419,17 +422,17 @@ class UserLogService
OR
OR
(
$result_agent_id
==
$agent_id
)
//客方可以看
(
$result_agent_id
==
$agent_id
)
//客方可以看
OR
OR
((
$is_vip
==
1
)
and
(
$examine_vip
==
0
))
((
$is_vip
==
1
)
and
(
$examine_vip
==
0
))
OR
OR
((
$is_outpace_call_num
==
0
)
and
(
$is_outstrip_twenty_four_hours
==
0
)
and
((
$is_user_agent_boss
==
0
)
or
(
in_array
(
$agent_id
,
$user_agent_list_arr
))
or
(
$called
==
0
)))
((
$is_outpace_call_num
==
0
)
and
(
$is_outstrip_twenty_four_hours
==
0
)
and
((
$is_user_agent_boss
==
0
)
or
(
in_array
(
$agent_id
,
$user_agent_list_arr
))
or
(
$called
==
0
)))
OR
OR
((
$is_outpace_call_num
==
1
)
and
((
$is_user_agent_boss
==
0
)
or
(
in_array
(
$agent_id
,
$user_agent_list_arr
))
or
(
$called
==
0
)))
((
$is_outpace_call_num
==
1
)
and
((
$is_user_agent_boss
==
0
)
or
(
in_array
(
$agent_id
,
$user_agent_list_arr
))
or
(
$called
==
0
)))
OR
OR
(
$is_report
==
0
)
(
$is_report
==
0
)
){
)
{
return
0
;
//0:显示
return
0
;
//0:显示
}
}
return
$result_val
;
return
$result_val
;
}
}
/**
/**
...
@@ -440,19 +443,19 @@ class UserLogService
...
@@ -440,19 +443,19 @@ class UserLogService
*/
*/
public
function
userDetailIsCollect
(
$user_id
,
$agent_id
)
public
function
userDetailIsCollect
(
$user_id
,
$agent_id
)
{
{
$is_collect
=
2
;
$is_collect
=
2
;
$collect_house
=
new
ACollectUser
();
$collect_house
=
new
ACollectUser
();
$agent_ids
=
$this
->
getSiteAgentId
(
$agent_id
);
$agent_ids
=
$this
->
getSiteAgentId
(
$agent_id
);
if
(
$agent_ids
)
{
if
(
$agent_ids
)
{
//此经纪人有转勤账号
//此经纪人有转勤账号
$insert
[
"agents_id"
]
=
array
(
'in'
,
$agent_ids
);
$insert
[
"agents_id"
]
=
array
(
'in'
,
$agent_ids
);
}
else
{
}
else
{
$insert
[
"agents_id"
]
=
$agent_id
;
$insert
[
"agents_id"
]
=
$agent_id
;
}
}
$insert
[
"user_id"
]
=
$user_id
;
$insert
[
"user_id"
]
=
$user_id
;
$insert
[
"status"
]
=
1
;
$insert
[
"status"
]
=
1
;
$is_saved
=
$collect_house
->
getCollectUser
(
'id'
,
$insert
);
$is_saved
=
$collect_house
->
getCollectUser
(
'id'
,
$insert
);
if
(
$is_saved
)
{
if
(
$is_saved
)
{
$is_collect
=
1
;
$is_collect
=
1
;
}
}
...
@@ -466,14 +469,14 @@ class UserLogService
...
@@ -466,14 +469,14 @@ class UserLogService
*/
*/
public
function
getSiteAgentId
(
$agent_id
)
public
function
getSiteAgentId
(
$agent_id
)
{
{
$m_agent
=
new
AAgents
();
$m_agent
=
new
AAgents
();
$agent_phone
=
$m_agent
->
getAgentsById
(
$agent_id
,
'phone'
);
$agent_phone
=
$m_agent
->
getAgentsById
(
$agent_id
,
'phone'
);
$params
=
[];
$params
=
[];
$params
[
"phone"
]
=
$agent_phone
;
$params
[
"phone"
]
=
$agent_phone
;
$params
[
"status"
]
=
array
(
'in'
,
'0,3'
);
$params
[
"status"
]
=
array
(
'in'
,
'0,3'
);
$agentsArr
=
$m_agent
->
getAgentsByStoreId
(
$params
);
$agentsArr
=
$m_agent
->
getAgentsByStoreId
(
$params
);
$agent_total
=
count
(
$agentsArr
);
$agent_total
=
count
(
$agentsArr
);
$agent_ids
=
""
;
$agent_ids
=
""
;
if
(
$agent_total
>
0
)
{
if
(
$agent_total
>
0
)
{
...
@@ -494,10 +497,10 @@ class UserLogService
...
@@ -494,10 +497,10 @@ class UserLogService
* @param $agent_id
* @param $agent_id
* @return int
* @return int
*/
*/
public
function
userDetailIsOutpaceCallNum
(
$user_id
,
$user_phone
,
$agent_id
)
public
function
userDetailIsOutpaceCallNum
(
$user_id
,
$user_phone
,
$agent_id
)
{
{
$is_outpace_call_num
=
0
;
$is_outpace_call_num
=
0
;
$clientService
=
new
ClientService
();
$clientService
=
new
ClientService
();
if
(
!
$clientService
->
dialTotal
(
$user_id
))
{
if
(
!
$clientService
->
dialTotal
(
$user_id
))
{
$is_outpace_call_num
=
1
;
$is_outpace_call_num
=
1
;
}
}
...
@@ -513,89 +516,57 @@ class UserLogService
...
@@ -513,89 +516,57 @@ class UserLogService
public
function
userDetailIsOutpaceCallNum5
(
$user_id
)
public
function
userDetailIsOutpaceCallNum5
(
$user_id
)
{
{
$is_outpace_call_num
=
0
;
$is_outpace_call_num
=
0
;
$clientService
=
new
ClientService
();
$clientService
=
new
ClientService
();
if
(
!
$clientService
->
dialTotal
(
$user_id
))
{
if
(
!
$clientService
->
dialTotal
(
$user_id
))
{
$is_outpace_call_num
=
1
;
$is_outpace_call_num
=
1
;
}
}
return
$is_outpace_call_num
;
//0拨打不超过5次 1超过5次
return
$is_outpace_call_num
;
//0拨打不超过5次 1超过5次
}
}
public
function
userDetailIsOutpaceCallNumPhone
(
$user_phone
,
$agent_id
)
public
function
userDetailIsOutpaceCallNumPhone
(
$user_phone
,
$agent_id
)
{
{
$is_outpace_call_num
=
0
;
$is_outpace_call_num
=
0
;
$m_agent_phone
=
new
AAgentsPhone
();
$m_agent_phone
=
new
AAgentsPhone
();
$redis
=
RedisExt
::
getRedis
();
$redis
=
RedisExt
::
getRedis
();
$phone
=
$this
->
agentModel
->
getAgentsById
(
$agent_id
,
'phone'
);
$phone
=
$this
->
agentModel
->
getAgentsById
(
$agent_id
,
'phone'
);
$is_privacy
=
$redis
->
get
(
's_is_privacy'
);
//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
$is_privacy
=
$redis
->
get
(
's_is_privacy'
);
//判断是否当前经纪人跟当前客户是否有电话绑定 从redis查询
if
(
empty
(
$phone
))
{
if
(
empty
(
$phone
))
{
$phone
=
$m_agent_phone
->
getAgentsByWhere
([
'agent_id'
=>
$agent_id
],
'phone'
);
$phone
=
$m_agent_phone
->
getAgentsByWhere
([
'agent_id'
=>
$agent_id
],
'phone'
);
}
}
$call_key
=
'call_'
.
$agent_id
.
'_'
.
$phone
.
'_'
.
$user_phone
.
'_'
.
$is_privacy
;
$call_key
=
'call_'
.
$agent_id
.
'_'
.
$phone
.
'_'
.
$user_phone
.
'_'
.
$is_privacy
;
$redis_res
=
$redis
->
get
(
$call_key
);
$redis_res
=
$redis
->
get
(
$call_key
);
if
(
empty
(
$redis_res
))
{
if
(
empty
(
$redis_res
))
{
$is_outpace_call_num
=
1
;
$is_outpace_call_num
=
1
;
}
}
return
$is_outpace_call_num
;
//0有绑定关系 1无绑定关系
return
$is_outpace_call_num
;
//0有绑定关系 1无绑定关系
}
}
/**
/**
* 查询客户邀请人
* 查询客户邀请人
* @param $referrer_id
* @param $referrer_id
* @param $referrer_source
* @param $referrer_source
* @return string
* @return string
*/
*/
public
function
userDetailUserInvite
(
$referrer_id
,
$referrer_source
)
public
function
userDetailUserInvite
(
$referrer_id
,
$referrer_source
)
{
{
if
(
$referrer_source
==
10
)
{
if
(
$referrer_source
==
10
)
{
$referrer_res
=
$this
->
userModel
->
verifyUser
(
'user_name,user_phone'
,
''
,
[
'id'
=>
$referrer_id
]);
$referrer_res
=
$this
->
userModel
->
verifyUser
(
'user_name,user_phone'
,
''
,
[
'id'
=>
$referrer_id
]);
$user_phone
=
empty
(
$referrer_res
[
'user_phone'
])
?
''
:
substr_replace
(
$referrer_res
[
'user_phone'
],
'****'
,
3
,
4
);
$user_phone
=
empty
(
$referrer_res
[
'user_phone'
])
?
''
:
substr_replace
(
$referrer_res
[
'user_phone'
],
'****'
,
3
,
4
);
$return
[
'invite_phone'
]
=
$user_phone
;
$return
[
'invite_phone'
]
=
$user_phone
;
$return
[
'invite_id'
]
=
$referrer_id
;
$return
[
'invite_id'
]
=
$referrer_id
;
}
else
{
}
else
{
$return
[
'invite_phone'
]
=
''
;
$return
[
'invite_phone'
]
=
''
;
$return
[
'invite_id'
]
=
''
;
$return
[
'invite_id'
]
=
''
;
if
(
$referrer_id
>
0
)
{
if
(
$referrer_id
>
0
)
{
$referrer_res
=
$this
->
agentModel
->
verifyUser
(
'name,phone'
,
''
,
[
'id'
=>
$referrer_id
]);
$referrer_res
=
$this
->
agentModel
->
verifyUser
(
'name,phone'
,
''
,
[
'id'
=>
$referrer_id
]);
$return
[
'invite_phone'
]
=
$referrer_res
[
'name'
]
.
'-'
.
$referrer_res
[
'phone'
];
$return
[
'invite_phone'
]
=
$referrer_res
[
'name'
]
.
'-'
.
$referrer_res
[
'phone'
];
$return
[
'invite_id'
]
=
''
;
$return
[
'invite_id'
]
=
''
;
}
}
}
}
return
$return
;
return
$return
;
}
}
/**
* 记录经纪人查看客户
*
* @param $user_id
* @param $agent_id
* @param $source
* @return bool
*/
public
function
agentLookUser
(
$user_id
,
$agent_id
,
$source
)
{
if
(
empty
(
$user_id
))
{
return
false
;
}
if
(
empty
(
$agent_id
))
{
return
false
;
}
$m_look_user
=
new
TLookAgentUserModel
();
// $redis_ext = RedisExt::getRedis();
// $key = 't_look_agent_user_' . $agent_id.'_'.$user_id;
// $num = $redis_ext->get($key);
// if (empty($num)) {
$id
=
$m_look_user
->
insertData
(
$user_id
,
$agent_id
,
$source
);
// $today_time = strtotime(date('Y-m-d') . ' 23:59:59') - time(); //到0点剩余时间
// $redis_ext->set($key, $id, $today_time);
// }
return
$id
;
}
}
}
\ No newline at end of file
application/model/TLookAgentUserModel.php
View file @
f5c2b11c
...
@@ -41,7 +41,18 @@ class TLookAgentUserModel extends BaseModel
...
@@ -41,7 +41,18 @@ class TLookAgentUserModel extends BaseModel
}
}
return
$id
;
return
$id
;
}
}
public
function
addLookUser
(
$params
)
{
Db
::
startTrans
();
try
{
$this
->
db_
->
insertAll
(
$params
);
Db
::
commit
();
return
1
;
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
return
0
;
}
}
public
function
delData
(
$where
)
public
function
delData
(
$where
)
{
{
return
$this
->
db_
->
where
(
$where
)
->
delete
();
return
$this
->
db_
->
where
(
$where
)
->
delete
();
...
...
application/task/controller/SaveLookUserHistoryTask.php
0 → 100644
View file @
f5c2b11c
<?php
namespace
app\task\controller
;
use
app\extra\RedisExt
;
use
app\model\AAgents
;
use
app\model\TLookAgentUserModel
;
use
think\Exception
;
use
think\Log
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/5/9
* Time : 下午4:45
* Intro:
*/
class
SaveLookUserHistoryTask
{
private
$redis
;
private
$yesterday
;
private
$agentsModel
;
private
$tLookAgentUserModel
;
const
LOOK_USER
=
"agent_look_user_"
;
//经纪人看用户key
const
IS_PC
=
"agent_look_user_by_pc"
;
//记录是哪里看的
function
__construct
()
{
$this
->
redis
=
RedisExt
::
getRedis
();
$this
->
yesterday
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
));
$this
->
agentsModel
=
new
AAgents
();
$this
->
tLookAgentUserModel
=
new
TLookAgentUserModel
();
}
/**
* 查询经纪人列表
* @return bool
*/
public
function
saveLookShop
()
{
if
(
!
$this
->
redis
)
{
return
;
}
$day
=
date
(
"Y-m-d"
,
time
());
if
(
$this
->
redis
->
get
(
"run_save_agent_look_user"
.
$day
))
{
return
;
}
$this
->
redis
->
set
(
"run_save_agent_look_user"
.
$day
,
1
,
24
*
3600
);
//todo 1.拿到每个经纪人的看铺记录 2.根据看铺记录统计出已看铺数量,3.根据经纪人id 拿到可看铺总数
$total
=
$this
->
agentsModel
->
getAgentsCountByTask
();
$pageSize
=
100
;
$pageTotal
=
ceil
(
$total
/
$pageSize
);
for
(
$pageNo
=
1
;
$pageNo
<=
$pageTotal
;
$pageNo
++
)
{
$resultArr
=
$this
->
agentsModel
->
getAgentsListByLookShop
(
$pageNo
,
$pageSize
,
"id,name,phone"
);
$this
->
executeSave
(
$resultArr
);
unset
(
$resultArr
);
}
}
/**
* 保存看铺记录 清空redis缓存
* @param $resultArr
*/
private
function
executeSave
(
$resultArr
)
{
$list
=
[];
foreach
(
$resultArr
as
$key
=>
$value
)
{
$agent_id
=
$value
[
"id"
];
$selectKey
=
self
::
LOOK_USER
.
$this
->
yesterday
.
$agent_id
;
$collection
=
$this
->
redis
->
sMembers
(
$selectKey
);
foreach
(
$collection
as
$item
)
{
$getLookTimeKey
=
$selectKey
.
"_"
.
$item
;
$getLookIsPcKey
=
self
::
IS_PC
.
$this
->
yesterday
.
$agent_id
.
"_"
.
$item
;
$getLookLastTimeKey
=
$selectKey
.
"_"
.
$item
.
"_lastTime"
;
$getLookLastIsPcKey
=
self
::
IS_PC
.
$this
->
yesterday
.
$agent_id
.
"_"
.
$item
.
"_lastTime"
;
$lookTime
=
$this
->
redis
->
get
(
$getLookTimeKey
);
$getLookIsPc
=
$this
->
redis
->
get
(
$getLookIsPcKey
);
$getLookLastTime
=
$this
->
redis
->
get
(
$getLookLastTimeKey
);
$getLookLastIsPc
=
$this
->
redis
->
get
(
$getLookLastIsPcKey
);
if
(
$lookTime
&&
$getLookIsPc
)
{
array_push
(
$list
,
$this
->
tLookShopBin
(
$agent_id
,
$item
,
$getLookIsPc
,
$lookTime
));
}
if
(
$getLookLastTime
&&
$getLookLastIsPc
)
{
array_push
(
$list
,
$this
->
tLookShopBin
(
$agent_id
,
$item
,
$getLookLastIsPc
,
$getLookLastTime
));
}
//删除redis缓存
$this
->
redis
->
sRem
(
$selectKey
,
$item
);
$this
->
redis
->
del
(
$getLookTimeKey
);
$this
->
redis
->
del
(
$getLookIsPcKey
);
$this
->
redis
->
del
(
$getLookLastTimeKey
);
$this
->
redis
->
del
(
$getLookLastIsPcKey
);
}
try
{
$is_insert
=
-
1
;
if
(
!
empty
(
$list
))
{
$is_insert
=
$this
->
tLookAgentUserModel
->
addLookUser
(
$list
);
}
if
(
$is_insert
==
0
)
{
Log
::
record
(
"SaveLookUserHistoryTask--111----executeSave---save error"
,
"info"
);
}
}
catch
(
Exception
$exception
)
{
Log
::
record
(
"SaveLookUserHistoryTask---222---executeSave---save error"
.
$exception
,
"info"
);
}
$list
=
[];
}
unset
(
$list
);
}
private
function
tLookShopBin
(
$agent_id
,
$user_id
,
$source
,
$look_time
)
{
$arrBin
=
[];
$arrBin
[
'user_id'
]
=
$user_id
;
$arrBin
[
'agent_id'
]
=
$agent_id
;
$arrBin
[
'source'
]
=
$source
;
$arrBin
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
$look_time
);
$arrBin
[
"update_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
return
$arrBin
;
}
}
\ No newline at end of file
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