Master.php 1.34 KB
<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%master}}".
 *
 * @property string $id
 * @property string $master_id
 * @property string $name
 * @property string $pic
 * @property integer $create_time
 * @property integer $update_time
 */
class Master extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%master}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['live_nums', 'create_time', 'update_time'], 'integer'],
            [['name'], 'string', 'max' => 100],
            [['meta', 'pic'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'master_id' => 'Master ID',
            'name' => 'Name',
            'meta' => 'Meta',
            'pic' => 'Pic',
            'live_nums' => 'Live Nums',
            'create_time' => 'Create Time',
            'update_time' => 'Update Time',
        ];
    }
    
    public function behaviors() {
        return [
            [
                'class' => \yii\behaviors\TimestampBehavior::className(),
                'createdAtAttribute' => 'create_time',
                'updatedAtAttribute' => 'update_time',
            ]
        ];
    }
}