添加查询点位通过key查询
parent
c8497fe7d2
commit
4f4dca4961
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue