Commit 74ac4091 authored by zhuwei's avatar zhuwei

客户,最后跟进时间bug

parent f68906d7
......@@ -10,6 +10,7 @@ use app\index\service\BrokerService;
use app\index\service\UserService;
use app\model\AAgents;
use app\model\GOperatingRecords;
use app\model\OfficePhoneFollowUp;
use app\model\OfficeUPhoneFollowUp;
use app\model\UPhoneFollowUp;
use app\model\UPhoneFollowUpTemporary;
......@@ -352,7 +353,7 @@ class Member extends Basic{
// big_log(json_encode($where));
$fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.user_label,
a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand,a.user_status,a.source';
a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand,a.user_status,a.source,a.entrust_type';
try {
$return_user_list = $this->user->getUserAgent($pageNo, $pageSize, 'a.id DESC', $fields, $where, $type);
......@@ -361,6 +362,7 @@ class Member extends Basic{
$redis_cache = new RedisCacheService();
$call = new CallPhoneService();
$s_phone_follow_up = new UPhoneFollowUp($this->siteId);
$s_office_phone_follow_up = new OfficePhoneFollowUp($this->siteId);
$s_phone_follow_temp = new UPhoneFollowUpTemporary($this->siteId);
foreach ($return_user_list as $k=>$v) {
if (empty($v['agent_id'])) {
......@@ -376,17 +378,23 @@ class Member extends Basic{
}
$follow_time = $redis_cache->getRedisValue('follow_time_id_'.$v['id']);
if (empty($follow_time)) {
if (!isset($follow_time['follow_time'])) {
$params_['user_id']= $v['id'];
$order= 'id desc';
$res = $s_phone_follow_temp->getPhoneFollowData('create_time',$params_,$order);
if (empty($res)) {
$res = $s_phone_follow_up->getPhoneFollowData('create_time',$params_,$order);
if($v['entrust_type'] == 1){
$res = $s_office_phone_follow_up->getPhoneFollowData('create_time',$params_,$order);
}else{
$res = $s_phone_follow_temp->getPhoneFollowData('create_time',$params_,$order);
if (!$res) {
$res = $s_phone_follow_up->getPhoneFollowData('create_time',$params_,$order);
}
}
$redis_cache->setRedisHashCache('follow_time_id_'.$v['id'], ['follow_time'=>$res[0]['create_time']], 3600);
if(isset($res[0]['create_time']) and $res[0]['create_time']){
$redis_cache->setRedisHashCache('follow_time_id_'.$v['id'], ['follow_time'=>$res[0]['create_time']], 3600);
}
} else {
$res[0]['create_time'] = $follow_time['follow_time'];
}
......
......@@ -322,7 +322,7 @@ class UPhoneFollowUp extends BaseModel
->where($params)
->limit(1)
->select();
//dump($this->getLastSql());
// dump($this->getLastSql());
return $result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment