<?php

namespace common\models;

use common\helpers\Cache;
use common\helpers\Date;
use common\helpers\Form;
use common\helpers\Tool;
use Yii;

/**
 * This is the model class for table "{{%USER_CLOSE}}".
 *
 * @property string $ID
 * @property string $USER_ID 会员ID
 * @property int $TYPE 类型
 * @property int $IS_MANUAL 是否手动操作
 * @property int $PERIOD_NUM 期数
 * @property int $IS_CLOSE 停|开
 * @property string $REMARK 备注
 * @property int $AUDIT_STATUS 审核状态
 * @property string $ADMIN_ID 操作管理员
 * @property string $AUDIT_ADMIN_ID 审核管理员
 * @property int $AUDITED_AT 审核时间
 * @property int $CREATED_AT 创建时间
 */
class UserClose extends \common\components\ActiveRecord
{
    const TYPE_GT = 1;
    const TYPE_TF = 2;

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

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['USER_ID', 'PERIOD_NUM', 'REMARK', 'CREATED_AT'], 'required'],
            [['TYPE', 'IS_MANUAL', 'PERIOD_NUM', 'IS_CLOSE', 'AUDIT_STATUS', 'AUDITED_AT', 'CREATED_AT'], 'integer'],
            [['ID', 'USER_ID', 'ADMIN_ID', 'AUDIT_ADMIN_ID'], 'string', 'max' => 32],
            [['REMARK'], 'string', 'max' => 255],
            [['ID'], 'unique'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'USER_ID' => '会员ID',
            'TYPE' => '类型',
            'IS_MANUAL' => '是否手动操作',
            'PERIOD_NUM' => '期数',
            'IS_CLOSE' => '停|开',
            'REMARK' => '备注',
            'AUDIT_STATUS' => '审核状态',
            'ADMIN_ID' => '操作管理员',
            'AUDIT_ADMIN_ID' => '审核管理员',
            'AUDITED_AT' => '审核时间',
            'CREATED_AT' => '创建时间',
        ];
    }
}
