<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%ORDER_GOODS_DEC}}".
 *
 * @property string $ID
 * @property string $ORDER_SN 订单ID
 * @property string $GOODS_TITLE 商品名称
 * @property string $PRICE 价格
 * @property string $REAL_PRICE 实际价格
 * @property string $PV 订货PV
 * @property string $REAL_PV 实际PV
 * @property string $POINT 兑换积分
 * @property int $PERIOD_NUM 期数
 * @property int $ORDER_DAY 日期
 * @property string $SKU_CODE 商品编码
 * @property int $BUY_NUMS 购买数量
 * @property string $P_CALC_MONTH 分区日期
 */
class OrderGoodsDec extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%ORDER_GOODS_DEC}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['ORDER_SN', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
            [['BUY_NUMS', 'PERIOD_NUM'], 'integer'],
            [['ID', 'ORDER_SN'], 'string', 'max' => 32],
            [['GOODS_TITLE'], 'string', 'max' => 255],
            [['SKU_CODE','ORDER_DAY'], 'string', 'max' => 16],
            [['ID'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'ORDER_SN' => '订单ID',
            'GOODS_TITLE' => '商品名称',
            'PRICE' => '价格',
            'REAL_PRICE' => '实际价格',
            'PV' => '订货BV',
            'REAL_PV' => '实际BV',
            'POINT' => '兑换积分',
            'PERIOD_NUM' => '期数',
            'ORDER_DAY' => '日期',
            'SKU_CODE' => '商品编码',
            'BUY_NUMS' => '购买数量',
            'P_CALC_MONTH' => '分区日期',
        ];
    }
}
