SsNodeIp.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. namespace App\Http\Models;
  3. use Eloquent;
  4. use Illuminate\Database\Eloquent\Builder;
  5. use Illuminate\Database\Eloquent\Model;
  6. use Illuminate\Support\Carbon;
  7. /**
  8. * SS节点在线IP信息
  9. *
  10. * @property int $id
  11. * @property int $node_id 节点ID
  12. * @property int $user_id 用户ID
  13. * @property int $port 端口
  14. * @property string $type 类型:all、tcp、udp
  15. * @property string|null $ip 连接IP:每个IP用,号隔开
  16. * @property Carbon $created_at 上报时间
  17. * @property-read SsNode $node
  18. * @property-read User $user
  19. * @method static Builder|SsNodeIp newModelQuery()
  20. * @method static Builder|SsNodeIp newQuery()
  21. * @method static Builder|SsNodeIp query()
  22. * @method static Builder|SsNodeIp whereCreatedAt($value)
  23. * @method static Builder|SsNodeIp whereId($value)
  24. * @method static Builder|SsNodeIp whereIp($value)
  25. * @method static Builder|SsNodeIp whereNodeId($value)
  26. * @method static Builder|SsNodeIp wherePort($value)
  27. * @method static Builder|SsNodeIp whereType($value)
  28. * @method static Builder|SsNodeIp whereUserId($value)
  29. * @mixin Eloquent
  30. */
  31. class SsNodeIp extends Model {
  32. protected $table = 'ss_node_ip';
  33. protected $primaryKey = 'id';
  34. function node() {
  35. return $this->belongsTo(SsNode::class, 'node_id', 'id');
  36. }
  37. function user() {
  38. return $this->belongsTo(User::class, 'port', 'port');
  39. }
  40. }