UserTrafficLog.php 1.6 KB

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