1234567891011121314151617181920212223242526272829 |
- <?php
- namespace app\model;
- use DateTimeInterface;
- use support\Model;
- class CollegeTeaching extends Model
- {
- protected $table = 'college_teaching';
- protected $primaryKey = 'teaching_id';
- protected $dateFormat = 'U';
- public const CREATED_AT = 'teaching_addTime';
- public const UPDATED_AT = 'teaching_updateTime';
- public function serializeDate(DateTimeInterface $date)
- {
- return $date->format("Y-m-d H:i:s");
- }
- public function course()
- {
- return $this->hasOne(CollegeCourses::class, 'courses_id', 'teaching_courses_id');
- }
- }
|