CollegeTeaching.php 586 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\model;
  3. use DateTimeInterface;
  4. use support\Model;
  5. class CollegeTeaching extends Model
  6. {
  7. protected $table = 'college_teaching';
  8. protected $primaryKey = 'teaching_id';
  9. protected $dateFormat = 'U';
  10. public const CREATED_AT = 'teaching_addTime';
  11. public const UPDATED_AT = 'teaching_updateTime';
  12. public function serializeDate(DateTimeInterface $date)
  13. {
  14. return $date->format("Y-m-d H:i:s");
  15. }
  16. public function course()
  17. {
  18. return $this->hasOne(CollegeCourses::class, 'courses_id', 'teaching_courses_id');
  19. }
  20. }