VideoUser.php 700 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 会员模型
  6. */
  7. class VideoUser extends Model
  8. {
  9. // 表名
  10. protected $name = 'video_user';
  11. // 开启自动写入时间戳字段
  12. protected $autoWriteTimestamp = 'int';
  13. // 定义时间戳字段名
  14. protected $createTime = 'createtime';
  15. protected $updateTime = 'updatetime';
  16. // 追加属性
  17. protected $append = [
  18. ];
  19. // 定义关联关系
  20. public function videolist()
  21. {
  22. return $this->belongsTo('Videolist', 'vid', 'id', [], 'LEFT')->setEagerlyType(0);
  23. }
  24. public function user()
  25. {
  26. return $this->belongsTo('User', 'uid', 'id', [], 'LEFT')->setEagerlyType(0);
  27. }
  28. }