33 lines
777 B
PHP
33 lines
777 B
PHP
<?php
|
|
|
|
namespace common\models;
|
|
|
|
use yii\behaviors\TimestampBehavior;
|
|
use yii\db\ActiveQuery;
|
|
use yii\db\ActiveRecord;
|
|
|
|
class PhysicalPackage extends \common\modelsgii\PhysicalPackage
|
|
{
|
|
public function behaviors(): array
|
|
{
|
|
return [
|
|
[
|
|
'class' => TimestampBehavior::class,
|
|
'attributes' => [
|
|
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
|
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
|
],
|
|
],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* 分院关联
|
|
* @return ActiveQuery
|
|
*/
|
|
public function getYardPhysical(): ActiveQuery
|
|
{
|
|
return $this->hasMany(HospitalYardPhysical::className(),['physical_id'=>'id']);
|
|
}
|
|
}
|