Compare commits
2 Commits
fc8d414a19
...
007f5bb08d
| Author | SHA1 | Date |
|---|---|---|
|
|
007f5bb08d | |
|
|
b1af62011e |
|
|
@ -38,8 +38,18 @@ class MonitorModeFilter extends ModelFilter
|
||||||
/**
|
/**
|
||||||
* 分组
|
* 分组
|
||||||
*/
|
*/
|
||||||
public function groupTags($groupTags)
|
public function groupTags($groupTags){
|
||||||
{
|
if(strpos($groupTags, ',')){
|
||||||
return $this->whereRaw("FIND_IN_SET(group_tags,'$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