初始化仓库
This commit is contained in:
32
common/models/GranularRepice.php
Normal file
32
common/models/GranularRepice.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class GranularRepice extends \common\modelsgii\GranularRepice
|
||||
{
|
||||
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at','updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 关联用量表
|
||||
*/
|
||||
public function getUseNum(){
|
||||
return $this->hasMany(DrugUseNum::class,['id'=>'consumption']);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user