<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "{{%RETURN_ORDER}}".
 *
 * @property string $ID
 * @property string $SN 订单号
 * @property string $DEC_SN 报单编号
 * @property string $USER_ID 用户ID
 * @property string $USER_NAME 会员编号
 * @property string $ORDER_TYPE 订货类型
 * @property string $ORDER_AMOUNT 订单总价格
 * @property string $PV 订货PV
 * @property string $PAY_AMOUNT 支付价格
 * @property string $PAY_PV 实付PV
 * @property string $PAY_TYPE 支付方式
 * @property int $PERIOD_NUM 期数
 * @property int $PROVINCE 省份名称
 * @property int $CITY 城市名称
 * @property int $COUNTY 县区
 * @property string $ADDRESS 详细地址
 * @property int $CREATE_AT 订单创建时间
 * @property int $PAY_STATUS 支付状态
 * @property string $PAY_NOTE 支付信息
 */
class ReturnOrder extends \common\components\ActiveRecord
{
    /**
     * {@inheritdoc}
     */
    public static function tableName()
    {
        return '{{%RETURN_ORDER}}';
    }

    /**
     * {@inheritdoc}
     */
    public function rules()
    {
        return [
            [['USER_ID', 'SN', 'ORDER_TYPE'], 'required'],
            [['ORDER_AMOUNT', 'PV', 'PAY_AMOUNT', 'PAY_PV', 'CREATE_AT'], 'number'],
            [['ORDER_PERIOD_NUM','PERIOD_NUM', 'PROVINCE', 'CITY', 'COUNTY'], 'integer'],
            [['ID','SN', 'DEC_SN', 'USER_ID','PAY_TYPE'], 'string', 'max' => 32],
            [['USER_NAME'], 'string', 'max' => 16],
            [['ORDER_TYPE'], 'string', 'max' => 12],
            [['ADDRESS'], 'string', 'max' => 255],
            [['SN'], 'unique'],
        ];
    }

    /**
     * {@inheritdoc}
     */
    public function attributeLabels()
    {
        return [
            'ID' => 'ID',
            'SN' => '订单号',
            'DEC_SN' => '报单编号',
            'USER_ID' => '用户ID',
            'USER_NAME' => '会员编号',
            'ORDER_TYPE' => '订货类型',
            'ORDER_AMOUNT' => '订单总价格',
            'PV' => '订货PV',
            'PAY_AMOUNT' => '支付价格',
            'PAY_PV' => '实付PV',
            'PAY_TYPE' => '支付方式',
            'ORDER_PERIOD_NUM' => '原订单期数',
            'PERIOD_NUM' => '期数',
            'UPGRADE_TYPE' => '升级报单类型',
            'PROVINCE' => '省份名称',
            'CITY' => '城市名称',
            'COUNTY' => '县区',
            'ADDRESS' => '详细地址',
            'CREATE_AT' => '订单创建时间',
            'ORI_CASH' => '删除订单退还前用户的余额',
            'ADMIN_ID' => '删除订单人ID',
            'ORI_BONUS' => '删除订单前用户奖金',
            'ORI_EXCHANGE_POINTS' => '删前用户无业绩兑换点数',
            'ORI_RECONSUME_POINTS' => '删除前用户复销点数',
            'ORI_DEC_LV' => '删前级别',
            'RETURN_DEC_LV' => '删后级别',
            'IS_LOCKING' => '此单是否会锁定会员'
        ];
    }
}
