|
|
|
|
@ -43,6 +43,44 @@ class TestController extends Controller
|
|
|
|
|
{
|
|
|
|
|
$neirong =request('neirong');
|
|
|
|
|
|
|
|
|
|
return DB::statement($neirong);
|
|
|
|
|
return DB::select($neirong);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//批量加密信息
|
|
|
|
|
public function jiami()
|
|
|
|
|
{
|
|
|
|
|
$count=DB::select("select count(*) as c from appointment_record where LENGTH(id_card_num)=18 ");
|
|
|
|
|
$list=DB::select("select * from appointment_record where LENGTH(id_card_num)=18 limit 10");
|
|
|
|
|
$shu=0;
|
|
|
|
|
if(count($list)>0){
|
|
|
|
|
|
|
|
|
|
foreach ($list as $item){
|
|
|
|
|
$HSM_sfz =\App\Lib\HSM::HsmEncrypt($item->id_card_num);
|
|
|
|
|
if($HSM_sfz['status']!=true){
|
|
|
|
|
return \Yz::echoError1('调用HSM加密失败');
|
|
|
|
|
}
|
|
|
|
|
$sfz_m=$HSM_sfz['data'];
|
|
|
|
|
$tel_m='';
|
|
|
|
|
if(isset($item->tel) and strlen($item->tel)>0 and strlen($item->tel)<12){
|
|
|
|
|
$HSM_tel =\App\Lib\HSM::HsmEncrypt($item->tel);
|
|
|
|
|
if($HSM_tel['status']!=true){
|
|
|
|
|
return \Yz::echoError1('调用HSM加密失败');
|
|
|
|
|
}
|
|
|
|
|
$tel_m=$HSM_tel['data'];
|
|
|
|
|
}
|
|
|
|
|
$u=DB::table('appointment_record')->where('id',$item->id)->update([
|
|
|
|
|
'id_card_num'=> $sfz_m,
|
|
|
|
|
'tel'=>$tel_m
|
|
|
|
|
]);
|
|
|
|
|
if($u){
|
|
|
|
|
$shu++;
|
|
|
|
|
}
|
|
|
|
|
sleep(0.5);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
echo"执行完毕,共有待处理:".$count[0]->c."条,共更新".$shu."条";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|