<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%CALC_MONTH_BONUS_USER}}".
 *
 * @property string $ID
 * @property string $USER_ID 用户ID
 * @property int $CALC_MONTH 结算月
 * @property int $CREATED_AT 创建时间
 */
class CalcMonthBonusUser extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%CALC_MONTH_BONUS_USER}}';
    }

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

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'USER_ID' => '用户ID',
            'CALC_MONTH' => '结算月',
            'CREATED_AT' => '创建时间',
        ];
    }
}
