智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.6 KiB

<?php
// +----------------------------------------------------------------------
// | Niucloud-admin 企业快速开发的多应用管理平台
// +----------------------------------------------------------------------
// | 官方网址:https://www.niucloud.com
// +----------------------------------------------------------------------
// | niucloud团队 版权所有 开源版本可自由商用
// +----------------------------------------------------------------------
// | Author: Niucloud Team
// +----------------------------------------------------------------------
namespace app\model\class_personnel_rel;
use core\base\BaseModel;
use think\model\concern\SoftDelete;
use think\model\relation\HasMany;
use think\model\relation\HasOne;
use app\model\student\Student;
use app\model\student_courses\StudentCourses;
use app\model\class_grade\ClassGrade;
use app\model\customer_resources\CustomerResources;
use app\model\campus\Campus;
class ClassPersonnelRel extends BaseModel
{
/**
* 数据表主键
* @var string
*/
protected $pk = 'id';
/**
* 模型名称
* @var string
*/
protected $name = 'class_personnel_rel';
public function student(){
return $this->hasOne(Student::class, 'id', 'source_id');
}
public function studentCourses(){
return $this->hasOne(StudentCourses::class, 'student_id', 'source_id')->joinType('left')->withField('end_date,student_id')->bind(['end_date'=>'end_date']);
}
public function studentCoursesInfo(){
return $this->hasOne(StudentCourses::class, 'student_id', 'source_id');
}
}