course/app/common/model/TeacherScheduleTime.php

57 lines
1.3 KiB
PHP
Raw Normal View History

2024-07-14 21:35:58 +08:00
<?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
*/
2024-07-15 00:09:59 +08:00
class TeacherScheduleTime extends BaseModel
2024-07-14 21:35:58 +08:00
{
2024-07-15 00:09:59 +08:00
public function teacher()
2024-07-15 23:51:01 +08:00
{
return $this->hasOne(Teacher::class, 'id', 'teacher_id')->bind([
'teacher_account' => 'account',
'teacher_name',
'time_zone_name'
]);
}
public function teacherAttr()
2024-07-15 00:09:59 +08:00
{
return $this->hasOne(Teacher::class, 'id', 'teacher_id');
}
public function subject()
{
2024-07-15 23:51:01 +08:00
return $this->hasOne(Subject::class, 'id', 'subject_id')->bind(['subject_name', 'english_name']);
2024-07-15 00:09:59 +08:00
}
2024-07-15 23:51:01 +08:00
2024-07-15 17:26:13 +08:00
public function subjectArr()
{
return $this->hasOne(Subject::class, 'id', 'subject_id');
}
2024-07-15 23:51:01 +08:00
/**
* @desc 安排学生
* @return \think\model\relation\HasMany
*/
public function studentSchedule()
{
return $this->hasMany(StudentSchedule::class, 'teacher_schedule_time_id', 'id');
}
2024-07-14 21:35:58 +08:00
}