初始化仓库

This commit is contained in:
2024-09-19 11:32:39 +08:00
commit 8f5315e936
921 changed files with 76455 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
<?php
namespace common\models;
use yii\behaviors\TimestampBehavior;
use yii\db\ActiveRecord;
class HospitalDepartmentIntro extends \common\modelsgii\HospitalDepartmentIntro
{
public function behaviors()
{
return [
[
'class' => TimestampBehavior::class,
'attributes' => [
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
],
],
];
}
/**
* 获取科室信息
* @return \yii\db\ActiveQuery
*/
public function getDepartment()
{
return $this->hasMany(HospitalDepartment::className(),['id'=>'department_id']);
}
/**
* 获取分院信息
* @return \yii\db\ActiveQuery
*/
public function getYard()
{
return $this->hasOne(HospitalYard::className(),['id'=>'yard_id'])->select('id,name');
}
/**
* 获取分院医生信息
* @return \yii\db\ActiveQuery
*/
public function getDoctor()
{
return $this->hasMany(DoctorInfo::className(),['yard_id'=>'yard_id','depart_id'=>'department_id']);
}
}