UserTrafficLog.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Builder;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. /**
  7. * 用户流量记录
  8. *
  9. * @property int $id
  10. * @property int $user_id 用户ID
  11. * @property int $node_id 节点ID
  12. * @property int $u 上传流量
  13. * @property int $d 下载流量
  14. * @property float $rate 倍率
  15. * @property string $traffic 产生流量
  16. * @property int $log_time 记录时间
  17. * @property-read \App\Models\SsNode $node
  18. * @property-read \App\Models\User $user
  19. * @method static Builder|UserTrafficLog newModelQuery()
  20. * @method static Builder|UserTrafficLog newQuery()
  21. * @method static Builder|UserTrafficLog query()
  22. * @method static Builder|UserTrafficLog whereD($value)
  23. * @method static Builder|UserTrafficLog whereId($value)
  24. * @method static Builder|UserTrafficLog whereLogTime($value)
  25. * @method static Builder|UserTrafficLog whereNodeId($value)
  26. * @method static Builder|UserTrafficLog whereRate($value)
  27. * @method static Builder|UserTrafficLog whereTraffic($value)
  28. * @method static Builder|UserTrafficLog whereU($value)
  29. * @method static Builder|UserTrafficLog whereUserId($value)
  30. * @mixin \Eloquent
  31. */
  32. class UserTrafficLog extends Model {
  33. public $timestamps = false;
  34. protected $table = 'user_traffic_log';
  35. // 关联账号
  36. public function user(): BelongsTo {
  37. return $this->belongsTo(User::class, 'user_id', 'id');
  38. }
  39. // 关联节点
  40. public function node(): BelongsTo {
  41. return $this->belongsTo(SsNode::class, 'node_id', 'id');
  42. }
  43. }