43 lines
974 B
PHP
43 lines
974 B
PHP
<?php
|
|
|
|
namespace common\models;
|
|
|
|
use yii\db\ActiveRecord;
|
|
use yii\behaviors\TimestampBehavior;
|
|
use common\modelsgii\WestRecipe;
|
|
|
|
class WestRepice extends WestRecipe
|
|
{
|
|
|
|
public function behaviors()
|
|
{
|
|
return [
|
|
[
|
|
'class' => TimestampBehavior::class,
|
|
'attributes' => [
|
|
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
|
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
|
],
|
|
],
|
|
];
|
|
}
|
|
|
|
public function getUsetime(){
|
|
return $this->hasOne(DrugUseTime::class,['id'=>'time_id']);
|
|
}
|
|
|
|
|
|
public function getWestUnit(){
|
|
return $this->hasOne(WestUnit::class,['id'=>'wu_id']);
|
|
}
|
|
|
|
public function getUsetype(){
|
|
|
|
return $this->hasOne(DrugUseType::class,['id'=>'type_id']);
|
|
}
|
|
|
|
public function getFrequency(){
|
|
|
|
return $this->hasOne(DrugUseFrequency::class,['id'=>'f_id']);
|
|
}
|
|
} |