RuleLog.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Database\Eloquent\Model;
  5. /**
  6. * 触发审计规则日志
  7. *
  8. * @property int $id
  9. * @property int $user_id 用户ID
  10. * @property int $node_id 节点ID
  11. * @property int $rule_id 规则ID,0表示白名单模式下访问访问了非规则允许的网址
  12. * @property string $reason 触发原因
  13. * @property \Illuminate\Support\Carbon $created_at
  14. * @property \Illuminate\Support\Carbon $updated_at
  15. * @property-read \App\Models\SsNode|null $node
  16. * @property-read \App\Models\Rule|null $rule
  17. * @property-read \App\Models\User|null $user
  18. * @method static Builder|RuleLog newModelQuery()
  19. * @method static Builder|RuleLog newQuery()
  20. * @method static Builder|RuleLog query()
  21. * @method static Builder|RuleLog whereCreatedAt($value)
  22. * @method static Builder|RuleLog whereId($value)
  23. * @method static Builder|RuleLog whereNodeId($value)
  24. * @method static Builder|RuleLog whereReason($value)
  25. * @method static Builder|RuleLog whereRuleId($value)
  26. * @method static Builder|RuleLog whereUpdatedAt($value)
  27. * @method static Builder|RuleLog whereUserId($value)
  28. * @mixin \Eloquent
  29. */
  30. class RuleLog extends Model {
  31. protected $table = 'rule_log';
  32. protected $primaryKey = 'id';
  33. function user() {
  34. return $this->hasOne(User::class, 'id', 'user_id');
  35. }
  36. function node() {
  37. return $this->hasOne(SsNode::class, 'id', 'node_id');
  38. }
  39. function rule() {
  40. return $this->hasOne(Rule::class, 'id', 'rule_id');
  41. }
  42. }