2024-07-16 18:02:04 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace app\common\model;
|
|
|
|
|
|
|
|
use app\BaseModel;
|
|
|
|
use support\Model;
|
2024-08-16 10:26:13 +08:00
|
|
|
|
2024-07-16 18:02:04 +08:00
|
|
|
//
|
|
|
|
///**
|
|
|
|
// * wa_student_schedule 课表
|
|
|
|
// * @property integer $id (主键)
|
|
|
|
// * @property integer $student_id 学生
|
|
|
|
// * @property integer $teacher_schedule_time_id 教师排课id
|
|
|
|
// * @property mixed $teacher_schedule_time_detail 排课详情
|
|
|
|
// * @property integer $teacher_id 教师
|
|
|
|
// * @property integer $subject_id 学科
|
|
|
|
// * @property string $date_time 课程时间
|
|
|
|
// * @property string $date_start_time 课程开始时间
|
|
|
|
// * @property string $date_end_time 课程结束时间
|
|
|
|
// * @property mixed $created_at 创建时间
|
|
|
|
// * @property string $updated_at 更新时间
|
|
|
|
// * @property string $deleted_at
|
|
|
|
// */
|
|
|
|
class StudentSchedule extends BaseModel
|
|
|
|
{
|
2024-08-08 11:10:03 +08:00
|
|
|
|
2024-07-16 22:52:38 +08:00
|
|
|
public function teacher()
|
|
|
|
{
|
2024-08-19 22:48:14 +08:00
|
|
|
return $this->hasOne(Teacher::class, 'id', 'teacher_id')->bind([
|
|
|
|
'teacher_account' => 'account',
|
|
|
|
'teacher_openid' => 'openid',
|
|
|
|
'teacher_name'
|
|
|
|
]);
|
2024-07-16 22:52:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
public function subject()
|
|
|
|
{
|
|
|
|
return $this->hasOne(Subject::class, 'id', 'subject_id')->bind(['subject_name', 'english_name']);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function student()
|
|
|
|
{
|
2024-08-16 10:26:13 +08:00
|
|
|
return $this->hasOne(Student::class, 'id', 'student_id')->bind(['student_student_name' => 'student_name', 'student_account' => 'account']);
|
2024-07-16 22:52:38 +08:00
|
|
|
}
|
|
|
|
|
2024-08-08 11:10:03 +08:00
|
|
|
public function subjectHomeworkArr()
|
|
|
|
{
|
|
|
|
return $this->hasOne(SubjectHomework::class, 'teacher_schedule_time_id', 'teacher_schedule_time_id');
|
|
|
|
}
|
|
|
|
|
2024-07-16 18:02:04 +08:00
|
|
|
}
|