调整标签搜索
parent
f61ebd0606
commit
b1af62011e
|
|
@ -38,6 +38,17 @@ class MonitorModeFilter extends ModelFilter
|
|||
* 分组
|
||||
*/
|
||||
public function groupTags($groupTags){
|
||||
return $this->whereRaw("FIND_IN_SET(group_tags,$groupTags)");
|
||||
if(strpos($groupTags, ',')){
|
||||
$this->where(function($q) use ($groupTags) {
|
||||
foreach(explode(',', $groupTags) as $tag){
|
||||
$q->whereRaw("FIND_IN_SET('".$tag."',group_tags)");
|
||||
}
|
||||
return $q;
|
||||
});
|
||||
|
||||
}else{
|
||||
return $this->whereRaw("FIND_IN_SET('".$groupTags."',group_tags)");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue