SysUserProfile.php 938 Bytes
<?php

namespace common\models;

use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;
use domain\DBHelper;

/**
 * 系统用户附表
 * This is the model class for table "{{%sys_user_profile}}".
 */
class SysUserProfile extends ActiveRecord
{
    /**
     * 获取带数据库前缀的表名
     * @return string
     */
    public static function tableNameWithDbPrefix()
    {
        $dbName = DBHelper::getDbName(self::getDb());
        return $dbName . '.sys_user_profile';
    }

    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%sys_user_profile}}';
    }

    /**
     * @return array
     */
    public function behaviors()
    {
        return [
            'time' => [
                'class' => TimestampBehavior::className(),
                'createdAtAttribute' => 'created_at',
                'updatedAtAttribute' => 'updated_at',
            ]
        ];
    }
}