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. public function platform()
  24. {
  25. return $this->belongsTo('Platform', 'platform_id', 'id');
  26. }
  27. // public function videolist()
  28. // {
  29. // return $this->belongsTo('Videolist', 'videolist_id', 'id', [], 'LEFT')->setEagerlyType(0);
  30. // }
  31. // public function platform()
  32. // {
  33. // return $this->belongsTo('Platform', 'platform_id', 'id', [], 'LEFT')->setEagerlyType(0);
  34. // }
  35. // public function users()
  36. // {
  37. // return $this->belongsTo('User', 'uid', 'id', [], 'LEFT')->field('id,avatar,nickname,istel,mobile,isrz,level,group_id')->setEagerlyType(0);
  38. // }
  39. }