From e95a593b7350d77013da6752aad4f0cbe3169943 Mon Sep 17 00:00:00 2001 From: xxb Date: Tue, 14 Sep 2021 11:26:14 +0800 Subject: [PATCH] liche update for super admin not check ip and show full mobile --- admin/controllers/receiver/Clues.php | 12 ++++++++++-- admin/controllers/receiver/Customer.php | 14 ++++++++++++-- admin/hooks/Auth.php | 4 +++- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/admin/controllers/receiver/Clues.php b/admin/controllers/receiver/Clues.php index 871733ff..96bb5061 100644 --- a/admin/controllers/receiver/Clues.php +++ b/admin/controllers/receiver/Clues.php @@ -102,7 +102,11 @@ class Clues extends HD_Controller $val['cf_title'] = isset($cf_rows[$val['cf_id']]) ? $cf_rows[$val['cf_id']][0]['title'] : ''; $val['status_name'] = $status_arr[$val['status']]; $val['admin_name'] = isset($map_admin[$val['admin_id']]) ? $map_admin[$val['admin_id']] : ''; - $val['mobile_sub'] = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : ''; + if(SUPER_ADMIN == $this->role){ + $val['mobile_sub'] = $val['mobile']; + } else { + $val['mobile_sub'] = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : ''; + } $lists[] = $val; } } @@ -138,7 +142,11 @@ class Clues extends HD_Controller $info_show['status2List'] = array(array("id" => 1, "name" => '未回访'), array("id" => 2, "name" => '已回访')); $info_show['c_time'] = date('Y-m-d H:i', $re['c_time']); $info_show['en_time'] = $re['en_time']; - $info_show['mobile_sub'] = $re['mobile'] ? substr_replace($re['mobile'], '*****', 0, 5) : ''; + if(SUPER_ADMIN == $this->role){ + $info_show['mobile_sub'] = $re['mobile']; + } else { + $info_show['mobile_sub'] = $re['mobile'] ? substr_replace($re['mobile'], '*****', 0, 5) : ''; + } $resLogs = $this->mdOplogs->select(array('clue_id' => $id), 'c_time desc', 0, 0); foreach ($resLogs as $key => $value) { $setValue = array(); diff --git a/admin/controllers/receiver/Customer.php b/admin/controllers/receiver/Customer.php index 8d4323b0..627a0dad 100644 --- a/admin/controllers/receiver/Customer.php +++ b/admin/controllers/receiver/Customer.php @@ -93,11 +93,16 @@ class Customer extends HD_Controller $biz_id_arr = array_unique(array_column($rows, 'biz_id')); $biz_id_arr && $biz_rows = $this->biz_model->get_map_by_ids($biz_id_arr, 'id,biz_name'); foreach ($rows as $key => $val) { + if(SUPER_ADMIN == $this->role){ + $mobile_sub = $val['mobile']; + } else { + $mobile_sub = $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : ''; + } $lists[] = array( 'id' => $val['id'], 'name' => $val['name'], 'mobile' => $val['mobile'], - 'mobile_sub' => $val['mobile'] ? substr_replace($val['mobile'], '*****', 0, 5) : '', + 'mobile_sub' => $mobile_sub, 'cf_title' => $val['cf_title'], 'status_name' => $status_arr[$val['status']], 'admin_name' => isset($admin_rows[$val['admin_id']]) ? $admin_rows[$val['admin_id']][0]['uname'] : '', @@ -144,10 +149,15 @@ class Customer extends HD_Controller $rows_log = $this->customer_oplogs_model->select(array('customer_id' => $id), 'c_time desc', 0, 0); //用户信息 + if(SUPER_ADMIN == $this->role){ + $mobile_sub = $row['mobile']; + } else { + $mobile_sub = $row['mobile'] ? substr_replace($row['mobile'], '*****', 0, 5) : ''; + } $info = array( 'id' => $row['id'], 'name' => $row['name'], - 'mobile' => $row['mobile'] ? substr_replace($row['mobile'], '*****', 0, 5) : '', + 'mobile' => $mobile_sub, 'cf_title' => $row['cf_title'], 'c_time' => date('Y-m-d H:i:s', $row['c_time']), 'status' => $row['status'], diff --git a/admin/hooks/Auth.php b/admin/hooks/Auth.php index 0b6ab8f1..c9ef8caf 100644 --- a/admin/hooks/Auth.php +++ b/admin/hooks/Auth.php @@ -40,7 +40,9 @@ class Auth { $admin_user = $CI->sys_admin_model->get(array('id' => $user_info['id'])); $ip = get_client_ip(); $ip_arr = array(); - if($this->is_ignore($user_info['id'])){ + if(SUPER_ADMIN == $admin_user['role_id']){ + //超级管理员免检 + } else if($this->is_ignore($user_info['id'])){ //免检 } elseif(false !== strpos($_SERVER['HTTP_HOST'], "admin.dev.liche.cn") || false !== strpos($_SERVER['HTTP_HOST'], "admin.lc.haodian.cn")){ //开发测试免检