<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%SCORE_MONTH}}".
 *
 * @property string $ID ID
 * @property string $USER_ID 会员ID
 * @property string $BASE_SCORE 基础分数
 * @property string $LEVEL_SCORE 级别分数
 * @property string $UPGRADE_SCORE 升级分数
 * @property string $TOTAL_SCORE 总分数
 * @property int $PERIOD_NUM 期数
 * @property int $CALC_MONTH 结算月
 * @property int $CREATED_AT 创建时间
 */
class ScoreMonth extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%SCORE_MONTH}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['ID', 'USER_ID', 'CALC_MONTH', 'CREATED_AT'], 'required'],
            [['BASE_SCORE', 'LEVEL_SCORE', 'UPGRADE_SCORE', 'TOTAL_SCORE'], 'number'],
            [['PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
            [['ID', 'USER_ID'], 'string', 'max' => 32],
            [['ID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'USER_ID' => '会员ID',
            'BASE_SCORE' => '基础分数',
            'LEVEL_SCORE' => '级别分数',
            'UPGRADE_SCORE' => '升级分数',
            'TOTAL_SCORE' => '总分数',
            'PERIOD_NUM' => '期数',
            'CALC_MONTH' => '结算月',
            'CREATED_AT' => '创建时间',
        ];
    }
}
