初始化仓库
This commit is contained in:
22
common/models/BaseConfig.php
Normal file
22
common/models/BaseConfig.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace common\models;
|
||||
|
||||
use yii\behaviors\TimestampBehavior;
|
||||
use yii\db\ActiveRecord;
|
||||
|
||||
class BaseConfig extends \common\modelsgii\BaseConfig
|
||||
{
|
||||
public function behaviors()
|
||||
{
|
||||
return [
|
||||
[
|
||||
'class' => TimestampBehavior::class,
|
||||
'attributes' => [
|
||||
ActiveRecord::EVENT_BEFORE_INSERT => ['created_at', 'updated_at'],
|
||||
ActiveRecord::EVENT_BEFORE_UPDATE => ['updated_at'],
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user