初始化仓库
This commit is contained in:
43
common/models/WestRepice.php
Normal file
43
common/models/WestRepice.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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']);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user