VideoShare.php 889 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 会员模型
  6. */
  7. class VideoShare extends Model
  8. {
  9. // 表名
  10. protected $name = 'video_share';
  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. public function users()
  29. {
  30. return $this->belongsTo('User', 'uid', 'id', [], 'LEFT')->field('id,avatar,nickname,istel,mobile,isrz,level,group_id')->setEagerlyType(0);
  31. }
  32. }