<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%BA_APPROACH_ORDER_GOODS}}".
 *
 * @property string $ID
 * @property string $ORDER_SN 订单ID
 * @property string $GOODS_ID 商品ID
 * @property string $GOODS_TITLE 商品名称
 * @property string $PRICE 价格
 * @property string $REAL_PRICE 实际价格
 * @property string $PV 订货PV
 * @property string $REAL_PV 实际PV
 * @property string $TAX_RATE 税率
 * @property string $POINT 兑换积分
 * @property string $SKU_CODE 商品编码
 * @property int $BUY_NUMS 购买数量
 * @property string $P_CALC_MONTH 分区日期
 * @property int CATEGORY_TYPE 商品分类
 * @property int PAY_TYPE 支付方式
 * @property string $EMAIL Email
 */
class BaApproachOrderGoods extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%BA_APPROACH_ORDER_GOODS}}';
    }

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

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'ORDER_SN' => '订单ID',
            'GOODS_ID' => '商品ID',
            'GOODS_TITLE' => '商品名称',
            'PRICE' => '价格',
            'REAL_PRICE' => '实际价格',
            'PV' => '订货BV',
            'REAL_PV' => '实际BV',
            'TAX_RATE' => '税率',
            'POINT' => '兑换积分',
            'SKU_CODE' => '商品编码',
            'BUY_NUMS' => '购买数量',
            'P_CALC_MONTH' => '分区日期',
            'CATEGORY_TYPE' => '商品分类',
            'PAY_TYPE' => '支付方式',
            'EMAIL' => 'Email'
        ];
    }
}
