数据处理
This commit is contained in:
parent
403ff850e8
commit
ad95e1d721
|
|
@ -134,7 +134,13 @@ class Worker extends Backend
|
|||
$worker_ids = [];
|
||||
foreach ($list->items() as $item){
|
||||
$dt = $item->toArray();
|
||||
$dt['tel'] = substr($dt['tel'], 0, 3) . '****' . substr($dt['tel'], -4);
|
||||
$tel = $dt['tel'];
|
||||
if (preg_match('/^\d{7,}$/', $tel)) {
|
||||
$dt['tel'] = mb_substr($tel, 0, 3, 'UTF-8') . '****' . mb_substr($tel, -4, null, 'UTF-8');
|
||||
} else {
|
||||
// 不处理非手机号,比如中文名称
|
||||
$dt['tel'] = $tel;
|
||||
}
|
||||
$data[] = $dt;
|
||||
$worker_ids [] = $item['id'];
|
||||
}
|
||||
|
|
@ -159,8 +165,8 @@ class Worker extends Backend
|
|||
|
||||
|
||||
$result = array("total" => $list->total(), "rows" => $data);
|
||||
|
||||
return json($result);
|
||||
// dd($result);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user