80 lines
1.9 KiB
PHP
80 lines
1.9 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',
|
|
]);
|
|
}
|
|
|
|
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');
|
|
}
|
|
/**
|
|
* @desc 安排学生
|
|
* @return \think\model\relation\HasMany
|
|
*/
|
|
public function oneStudentSchedule()
|
|
{
|
|
return $this->hasOne(StudentSchedule::class, 'teacher_schedule_time_id', 'id');
|
|
}
|
|
|
|
public function studentScheduleOne1()
|
|
{
|
|
return $this->hasOne(StudentSchedule::class, 'teacher_schedule_time_id', 'id');
|
|
}
|
|
public function studentScheduleOne()
|
|
{
|
|
return $this->hasOne(StudentSchedule::class, 'teacher_schedule_time_id', 'id')->bind([
|
|
'student_name'
|
|
]);
|
|
}
|
|
|
|
public function studentHomework()
|
|
{
|
|
return $this->hasMany(StudentHomework::class, 'teacher_schedule_time_id', 'id');
|
|
}
|
|
|
|
}
|