Accept Merge Request #193: (feature/hant -> develop)
Merge Request: 数据处理 Created By: @todayswind Accepted By: @todayswind URL: https://g-bcrc3009.coding.net/p/allocatr/d/allocatr/git/merge/193?initial=true
This commit is contained in:
commit
8e382b3cbc
|
|
@ -134,7 +134,13 @@ class Worker extends Backend
|
||||||
$worker_ids = [];
|
$worker_ids = [];
|
||||||
foreach ($list->items() as $item){
|
foreach ($list->items() as $item){
|
||||||
$dt = $item->toArray();
|
$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;
|
$data[] = $dt;
|
||||||
$worker_ids [] = $item['id'];
|
$worker_ids [] = $item['id'];
|
||||||
}
|
}
|
||||||
|
|
@ -159,8 +165,8 @@ class Worker extends Backend
|
||||||
|
|
||||||
|
|
||||||
$result = array("total" => $list->total(), "rows" => $data);
|
$result = array("total" => $list->total(), "rows" => $data);
|
||||||
|
// dd($result);
|
||||||
return json($result);
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user