UserTrafficLog.php 1.6 KB

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