1
0
Fork 0

添加查询点位通过key查询

develop
vine_liutk 2023-08-07 11:46:03 +08:00
parent c8497fe7d2
commit 4f4dca4961
1 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,7 @@ namespace App\Filters;
use EloquentFilter\ModelFilter;
use App\Models\Device;
use App\Models\Keyword;
class MonitorModeFilter extends ModelFilter
{
@ -33,4 +34,16 @@ class MonitorModeFilter extends ModelFilter
};
return $this->where('type', $type);
}
/**
* 指定监控组
*/
public function customAppoint($customAppoint){
$tag = Keyword::where('key', $customAppoint)->first();
if($tag){
return $this->whereRaw("FIND_IN_SET('".$tag->id."',group_tags)");
}else{
return $this;
}
}
}