非管理员数据加密显示

master
zhengchanglong 5 years ago
parent e32491c108
commit dbaf93b630

@ -603,6 +603,12 @@ function encryptStr($str) {
return substr_replace($str, $stars_str, 3, $length-6);
}
/**
* 身份证加密
*
* @param $str
* @return mixed
*/
function encryptIdCard($str) {
$length = strlen($str);
$stars_str = "";
@ -610,4 +616,19 @@ function encryptIdCard($str) {
$stars_str = "****";
}
return substr_replace($str, $stars_str, $length-4, 4);
}
/**
* 真实名字加密
*
* @param $str
* @return mixed
*/
function encryptRealName($str) {
$length = strlen($str);
$stars_str = "";
if($length>=4){
$stars_str = "****";
}
return substr_replace($str, "**", 3, $length);
}

@ -348,6 +348,7 @@ class PromoteController extends ThinkController
$this->assign('commonset', M('Kuaijieicon')->where(['url'=>'Promote/lists/type/1','status'=>1])->find());
$companys = M('promote_company', 'tab_')->where(['status' => 1])->select();
$this->assign("is_admin",is_administrator());
$this->assign('companys', $companys);
$this->display();
}

@ -84,13 +84,21 @@
<tr>
<td class="l">真实姓名:</td>
<td class="r">
<input type="text" class="txt" name="real_name" value="{$data['real_name']}" disabled="disabled" style="background:#CCCCCC">
<if condition="$is_admin eq true ">
<input type="text" class="txt" name="real_name" value="{$data['real_name']}" disabled="disabled" style="background:#CCCCCC">
<else />
<input type="text" class="txt" name="real_name" value="{$data['real_name']|encryptRealName}" disabled="disabled" style="background:#CCCCCC">
</if>
</td>
</tr>
<tr>
<td class="l">手机号码:</td>
<td class="r">
<input type="text" class="txt" name="mobile_phone" value="{$data['mobile_phone']}" disabled="disabled" style="background:#CCCCCC">
<if condition="$is_admin eq true ">
<input type="text" class="txt" name="mobile_phone" value="{$data['mobile_phone']}" disabled="disabled" style="background:#CCCCCC">
<else />
<input type="text" class="txt" name="mobile_phone" value="{$data['mobile_phone']|encryptStr}" disabled="disabled" style="background:#CCCCCC">
</if>
</td>
</tr>
<tr>

@ -336,7 +336,7 @@
<if condition="$is_admin eq true ">
{:get_promote_name($data['promote_id'])}
<else />
{:get_promote_name($data['promote_id'])|encryptStr}
{:encryptStr(get_promote_name($data['promote_id']))}
</if>
</td>
<td>{$data.starttime|date='Y-m-d',###}至{$data.endtime|date='Y-m-d',###}</td>

@ -139,7 +139,7 @@
<if condition="$is_admin eq true ">
{:get_promote_name($data['promote_id'])}
<else />
{:get_promote_name($data['promote_id'])|encryptStr}
{:encryptStr(get_promote_name($data['promote_id']))}
</if>
</td>
<td><notempty name="data.create_time">{$data.create_time|date='Y-m-d H:i:s',###}<else />---</notempty></td>

Loading…
Cancel
Save