You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/common/models/Base.php

34 lines
667 B

5 years ago
<?php
/**
* Created by PhpStorm.
* User: zengchaoxin
* Date: 16/5/7
* Time: 下午11:02
*/
namespace common\models;
use Yii;
use yii\behaviors\TimestampBehavior;
use yii\db\Expression;
class Base extends \yii\db\ActiveRecord
{
public function behaviors()
{
return [
[
'class' => TimestampBehavior::className(),
'createdAtAttribute' => 'created_at',
'updatedAtAttribute' => 'updated_at',
'value' => new Expression('NOW()'),
],
];
}
public static function model($className=__CLASS__)
{
return parent::model($className);
}
}