28 lines
663 B
PHP
28 lines
663 B
PHP
<?php
|
|
|
|
namespace common\models;
|
|
|
|
use yii\behaviors\TimestampBehavior;
|
|
use yii\db\ActiveRecord;
|
|
|
|
class DiseaseCommon extends \common\modelsgii\DiseaseCommon
|
|
{
|
|
public function behaviors()
|
|
{
|
|
return [
|
|
[
|
|
'class' => TimestampBehavior::class,
|
|
'attributes' => [
|
|
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
|
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
|
],
|
|
],
|
|
];
|
|
}
|
|
|
|
public function getDisease()
|
|
{
|
|
return $this->hasOne(Disease::class,['id'=>'disease_id'])->select('id,name');
|
|
}
|
|
|
|
} |