diff --git a/api/controllers/wxapp/licheb/Customers.php b/api/controllers/wxapp/licheb/Customers.php index c6e7f3f0..612cc9b8 100644 --- a/api/controllers/wxapp/licheb/Customers.php +++ b/api/controllers/wxapp/licheb/Customers.php @@ -831,6 +831,7 @@ class Customers extends Wxapp !$page && $page = 1; !$size && $size = 10; + $show_log = false; //是否获取日志 if ($o_type == 1) { //创建时间排序 $orderby = 'c_time desc'; @@ -850,7 +851,9 @@ class Customers extends Wxapp if ($status == 1000) { $where['rid>'] = 0; $where['un_lock'] = 0; + $where['rec_time>'] = date('Y-m-d H:i:s'); $status = 0; + $show_log = true; } else { $biz_type == Biz_model::BIZ_TYPE_4s && $where['un_lock'] = 1; } @@ -944,7 +947,7 @@ class Customers extends Wxapp $fileds = 'id,rid,name,admin_id,mobile,level,car_json,is_top,cf_title,brand_id,cont_time,c_time,p_time,if_defeat ,of_id,of2_id,wxqy,status,biz_id,county_id,cid,brand_id,series_id,un_lock,rec_time'; $rows = $this->customers_model->select($where, $orderby, $page, $size, $fileds); - $lists = $this->listCustomerField(['rows' => $rows, 'biz_type' => $biz_type, 'group_id' => $group_id]); + $lists = $this->listCustomerField(['rows' => $rows, 'biz_type' => $biz_type, 'group_id' => $group_id, 'show_log' => $show_log]); } $data = [ 'list' => $lists, @@ -1021,6 +1024,18 @@ class Customers extends Wxapp $left_time = seconds_to_human($left_time, false); } } + $logList = []; + if ($param['show_log']) { + $logRows = $this->customer_oplogs_model->select(['customer_id' => $val['id']], 'id desc', 1, 3, + 'id,log,type,c_time'); + if ($logRows) { + foreach ($logRows as $key2 => $val2) { + $logRows[$key2]['content'] = $val['type'] == 2 ? '拨打电话' : $val2['log']; + $logRows[$key2]['c_time'] = date('Y.m.d H:i', $val2['c_time']); + } + $logList = $logRows; + } + } $lists[] = [ 'id' => $val['id'], 'name' => $val['name'], @@ -1040,7 +1055,8 @@ class Customers extends Wxapp 'cid' => $val['cid'], 'rid' => $val['rid'], 'un_lock' => intval($val['un_lock']), - 'left_time' => $left_time + 'left_time' => $left_time, + 'logList' => $logList, ]; } return $lists; diff --git a/api/controllers/wxapp/licheb/User.php b/api/controllers/wxapp/licheb/User.php index 23987121..d66ca176 100644 --- a/api/controllers/wxapp/licheb/User.php +++ b/api/controllers/wxapp/licheb/User.php @@ -334,7 +334,7 @@ class User extends Wxapp $clues_count = $this->clues_model->count(['biz_id' => $biz_id, 'status' => 1, 'status2' => 1]); $customer_op_list = []; if ($biz['type'] == Biz_model::BIZ_TYPE_4s) { - $where = ['biz_id' => $biz_id, 'status' => 0, 'un_lock' => 0, 'rid>' => 0]; + $where = ['biz_id' => $biz_id, 'status' => 0, 'un_lock' => 0, 'rid>' => 0, 'rec_time>' => date('Y-m-d H:i:s')]; $unlock_count = $this->customers_model->count($where); $customer_op_list[] = ['title' => '待解锁客户(人)', 'icon' => 'icon-daifenpei', 'total' => $unlock_count, 'page' => '/pages/customer/index']; } else {