mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-11 18:42:54 +00:00
feat: 新增多部门用户查询
This commit is contained in:
parent
df627b0ad5
commit
7bae000a28
@ -538,6 +538,16 @@ class UsersController extends AbstractController
|
||||
$query->select('userid')->from('web_socket_dialog_users')->where('dialog_id', $keys['dialog_id']);
|
||||
});
|
||||
}
|
||||
if ($keys['departments']) {
|
||||
if (!is_array($keys['departments'])) {
|
||||
$keys['departments'] = explode(",", $keys['departments']);
|
||||
}
|
||||
$builder->where(function($query) use ($keys) {
|
||||
foreach ($keys['departments'] AS $department) {
|
||||
$query->orWhereRaw("FIND_IN_SET('{$department}', department)");
|
||||
}
|
||||
});
|
||||
}
|
||||
if (in_array($sorts['az'], ['asc', 'desc'])) {
|
||||
$builder->orderBy('az', $sorts['az']);
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user