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']); } }