<?php

namespace common\models;

use common\helpers\Cache;
use common\helpers\Date;
use common\helpers\user\Info;
use common\helpers\user\Status;
use Yii;
use yii\base\Exception;
use yii\db\Expression;
use common\libs\logging\operate\valueType\Config as ValueTypeConfig;

/**
 * This is the model class for table "{{%RECONSUME_POOL}}".
 *
 * @property string $ID
 * @property string $USER_ID 会员ID
 * @property string $UNUSED_PV 未扣除PV
 * @property int $UNUSED_MONTH 未扣除月数
 * @property int $CREATED_AT 创建时间
 */
class ReconsumePool extends \common\components\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%RECONSUME_POOL}}';
    }

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

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'USER_ID' => '会员ID',
            'UNUSED_PV' => '未扣除PV',
            'UNUSED_MONTH' => '未扣除月数',
            'CREATED_AT' => '创建时间',
        ];
    }

    /**
     * 操作日志记录条件
     * @return array
     */
    public function attrLabelsWithLogType(){
        return [
            'USER_ID' => '会员ID',
            'UNUSED_PV' => '未扣除PV',
            'UNUSED_MONTH' => '未扣除月数',
        ];
    }
}
