mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-04 00:40:37 +00:00
【程序目录】优化用户读取
This commit is contained in:
parent
27533a9d95
commit
59b8281011
@ -57,6 +57,7 @@ class User extends AuthController
|
||||
['field_key', ''],
|
||||
['isMember', '']
|
||||
]);
|
||||
$where['label_id'] = stringToIntArray($where['label_id']);
|
||||
return app('json')->success($this->services->index($where));
|
||||
}
|
||||
|
||||
|
||||
@ -1110,3 +1110,17 @@ if (!function_exists('dump_sql')) {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('stringToIntArray')) {
|
||||
|
||||
/**
|
||||
* 处理ids等并过滤参数
|
||||
* @param string $string
|
||||
* @param string $separator
|
||||
* @return array
|
||||
*/
|
||||
function stringToIntArray(string $string, string $separator = ',')
|
||||
{
|
||||
return !empty($string) ? array_unique(array_diff(array_map('intval', explode($separator, $string)), [0])) : [];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user