Arrive search: Ignore datetime
This commit is contained in:
parent
2252819800
commit
f966b1521f
|
@ -78,7 +78,13 @@ function admin_arrive()
|
||||||
foreach ($users as $usr) {
|
foreach ($users as $usr) {
|
||||||
if (count($tokens) > 0) {
|
if (count($tokens) > 0) {
|
||||||
$match = false;
|
$match = false;
|
||||||
$index = join(' ', $usr->attributesToArray());
|
$data = collect($usr->toArray())->flatten()->filter(function ($value) {
|
||||||
|
// Remove empty values
|
||||||
|
return !empty($value) &&
|
||||||
|
// Skip datetime
|
||||||
|
!preg_match('/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{6}Z$/', (string) $value);
|
||||||
|
});
|
||||||
|
$index = join(' ', $data->toArray());
|
||||||
foreach ($tokens as $token) {
|
foreach ($tokens as $token) {
|
||||||
$token = trim($token);
|
$token = trim($token);
|
||||||
if (!empty($token) && stristr($index, $token)) {
|
if (!empty($token) && stristr($index, $token)) {
|
||||||
|
|
Loading…
Reference in New Issue