mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-30 14:31:04 +00:00
【程序目录】用户列表标签搜索优化
This commit is contained in:
parent
eebc637bea
commit
9a44d705b1
@ -171,10 +171,15 @@ class UserWechatUserDao extends BaseDao
|
||||
}
|
||||
//用户标签
|
||||
if (isset($where['label_id']) && $where['label_id']) {
|
||||
$model = $model->where(function ($query) use ($where, $userAlias) {
|
||||
$labelIds = explode(',', $where['label_id']);
|
||||
foreach ($labelIds as $item) {
|
||||
$query->whereFindInSet($userAlias . 'label_ids', $item);
|
||||
$model = $model->whereIn($userAlias . 'uid', function ($query) use ($where) {
|
||||
if (is_array($where['label_id'])) {
|
||||
$query->name('user_label_relation')->whereIn('label_id', $where['label_id'])->field('uid')->select();
|
||||
} else {
|
||||
if (strpos($where['label_id'], ',') !== false) {
|
||||
$query->name('user_label_relation')->whereIn('label_id', explode(',', $where['label_id']))->field('uid')->select();
|
||||
} else {
|
||||
$query->name('user_label_relation')->where('label_id', $where['label_id'])->field('uid')->select();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user