UniversityCourseChapterModel.php 638 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\common\model;
  3. use think\Db;
  4. use think\Model;
  5. /**
  6. * 群组
  7. */
  8. class UniversityCourseChapterModel extends Model
  9. {
  10. // 表名
  11. protected $name = 'university_course_chapter';
  12. // 开启自动写入时间戳字段
  13. protected $autoWriteTimestamp = false;
  14. // 定义时间戳字段名
  15. protected $createTime = false;
  16. protected $updateTime = false;
  17. protected $deleteTime = false;
  18. public function getVideoAttr($value, $data)
  19. {
  20. return cdnurl($value);
  21. }
  22. public function course()
  23. {
  24. return $this->hasOne(UniversityCourseModel::class, 'id', 'course_id');
  25. }
  26. }