Income.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. namespace app\common\model;
  3. use think\Model;
  4. /**
  5. * 会员模型
  6. */
  7. class Income extends Model
  8. {
  9. // 表名
  10. protected $name = 'video_platform';
  11. // 开启自动写入时间戳字段
  12. protected $autoWriteTimestamp = 'int';
  13. // 定义时间戳字段名
  14. protected $createTime = 'createtime';
  15. protected $updateTime = 'updatetime';
  16. // 追加属性
  17. protected $append = [];
  18. // 定义关联关系
  19. // public function videolist()
  20. // {
  21. // return $this->belongsTo('Videolist', 'videolist_id', 'id');
  22. // }
  23. //
  24. // public function platform()
  25. // {
  26. // return $this->belongsTo('Platform', 'platform_id', 'id');
  27. // }
  28. public function videolist()
  29. {
  30. return $this->belongsTo('Videolist', 'videolist_id', 'id', [], 'LEFT')->setEagerlyType(0);
  31. }
  32. public function platform()
  33. {
  34. return $this->belongsTo('Platform', 'platform_id', 'id', [], 'LEFT')->setEagerlyType(0);
  35. }
  36. // public function users()
  37. // {
  38. // return $this->belongsTo('User', 'uid', 'id', [], 'LEFT')->field('id,avatar,nickname,istel,mobile,isrz,level,group_id')->setEagerlyType(0);
  39. // }
  40. }