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