<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%DEC_ROLE_LOG}}".
 *
 * @property string $ID
 * @property string $USER_ID 会员ID
 * @property string $FROM_ID 变动前的级别
 * @property string $TO_ID 变动后的级别
 * @property string $ADMIN_ID admin id
 * @property int $PERIOD_NUM 变动的期数
 * @property int $CALC_MONTH 变动的结算月
 * @property string $REMARK 备注
 * @property int $STATUS 状态
 * @property int $CREATED_AT 创建时间
 */
class DecRoleLog extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%DEC_ROLE_LOG}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['ID', 'USER_ID', 'FROM_ID', 'TO_ID', 'PERIOD_NUM', 'CALC_MONTH', 'REMARK', 'CREATED_AT'], 'required'],
            [['PERIOD_NUM', 'CALC_MONTH', 'STATUS', 'CREATED_AT'], 'integer'],
            [['REMARK'], 'string'],
            [['ID', 'USER_ID', 'FROM_ID', 'TO_ID', 'ADMIN_ID'], 'string', 'max' => 32],
            [['ID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'USER_ID' => '会员ID',
            'FROM_ID' => '变动前的级别',
            'TO_ID' => '变动后的级别',
            'ADMIN_ID' => '管理员id',
            'PERIOD_NUM' => '变动的期数',
            'CALC_MONTH' => '变动的结算月',
            'REMARK' => '备注',
            'STATUS' => '状态',
            'CREATED_AT' => '创建时间',
        ];
    }
}
