You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ss-panel-v3-mod_Uim2/app/Models/DetectLog.php

43 lines
968 B
PHTML

9 years ago
<?php
namespace App\Models;
class DetectLog extends Model
{
protected $connection = 'default';
protected $table = 'detect_log';
9 years ago
public function DetectRule()
{
$rule = DetectRule::where('id', $this->attributes['list_id'])->first();
9 years ago
if ($rule == null) {
self::where('id', '=', $this->attributes['id'])->delete();
9 years ago
return null;
}
return $rule;
9 years ago
}
public function User()
{
$user = User::where('id', $this->attributes['user_id'])->first();
9 years ago
if ($user == null) {
self::where('id', '=', $this->attributes['id'])->delete();
9 years ago
return null;
}
return $user;
9 years ago
}
public function Node()
{
$node = Node::where('id', $this->attributes['node_id'])->first();
9 years ago
if ($node == null) {
self::where('id', '=', $this->attributes['id'])->delete();
9 years ago
return null;
}
return $node;
9 years ago
}
}