Commit a9cbf937 by 杨树贤

修复bug

parent ff15a419
......@@ -19,25 +19,27 @@ class SupplierContactTransformer
$emailTemp = explode('@', $item['supplier_email'])[0];
$replace = str_pad('*', strlen($emailTemp), '*');
$emailTemp = str_replace($emailTemp, $replace, $emailTemp);
$item['supplier_email'] = $emailTemp . '@' . explode('@', $item['supplier_email'])[1];
$item['supplier_email'] = $emailTemp . '@' . isset(explode('@',
$item['supplier_email'])[1]) ? explode('@', $item['supplier_email'])[1] : '***';
}
if (!empty($item['supplier_mobile'])) {
$temp = substr($item['supplier_mobile'], 3, 4);
$item['supplier_mobile'] = str_replace($temp, '****' , $item['supplier_mobile']);
$item['supplier_mobile'] = str_replace($temp, '****', $item['supplier_mobile']);
}
if (!empty($item['supplier_qq'])) {
$temp = substr($item['supplier_qq'], 2, strlen($item['supplier_qq']));
$replace = str_pad('*', strlen($temp), '*');
$item['supplier_qq'] = str_replace($temp, $replace , $item['supplier_qq']);
$item['supplier_qq'] = str_replace($temp, $replace, $item['supplier_qq']);
}
if (!empty($item['supplier_telephone'])) {
if (count(explode('-', $item['supplier_telephone']))>1) {
if (count(explode('-', $item['supplier_telephone'])) > 1) {
$temp = explode('-', $item['supplier_telephone'])[1];
$replace = str_pad('*', strlen($temp), '*');
$item['supplier_telephone'] = str_replace($temp, $replace , $item['supplier_telephone']);
}else{
$item['supplier_telephone'] = str_replace($temp, $replace, $item['supplier_telephone']);
} else {
$replace = str_pad('*', strlen($item['supplier_telephone']), '*');
$item['supplier_telephone'] = str_replace($item['supplier_telephone'], $replace , $item['supplier_telephone']);
$item['supplier_telephone'] = str_replace($item['supplier_telephone'], $replace,
$item['supplier_telephone']);
}
}
......
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 sign in to comment