course/app/common/model/TeacherScheduleTime.php

58 lines
1.3 KiB
PHP

<?php
namespace app\common\model;
use app\BaseModel;
use support\Model;
/**
* wa_teacher_free_time 教师空闲时间
* @property integer $id (主键)
* @property integer $teacher_id 教师
* @property string $date 日期
* @property string $time 时间
* @property string $hour 课时
* @property mixed $created_at 创建时间
* @property string $updated_at 更新时间
* @property string $deleted_at
*/
class TeacherScheduleTime extends BaseModel
{
public function teacher()
{
return $this->hasOne(Teacher::class, 'id', 'teacher_id')->bind([
'teacher_account' => 'account',
'teacher_name',
'time_zone_name',
'time_zone_offset'
]);
}
public function teacherAttr()
{
return $this->hasOne(Teacher::class, 'id', 'teacher_id');
}
public function subject()
{
return $this->hasOne(Subject::class, 'id', 'subject_id')->bind(['subject_name', 'english_name']);
}
public function subjectArr()
{
return $this->hasOne(Subject::class, 'id', 'subject_id');
}
/**
* @desc 安排学生
* @return \think\model\relation\HasMany
*/
public function studentSchedule()
{
return $this->hasMany(StudentSchedule::class, 'teacher_schedule_time_id', 'id');
}
}