1
0
Fork 0

调整标签搜索

develop
vine_liutk 2023-05-29 14:42:01 +08:00
parent f61ebd0606
commit b1af62011e
1 changed files with 12 additions and 1 deletions

View File

@ -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)");
}
}
}