<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "caiwu_excel_t".
 *
 * @property integer $id
 * @property integer $import_id
 * @property string $field0
 * @property string $field1
 * @property string $field2
 * @property string $field3
 * @property string $field4
 * @property string $field5
 * @property string $field6
 * @property string $field7
 * @property string $field8
 * @property string $field9
 * @property string $field10
 * @property string $field11
 * @property string $field12
 * @property string $field13
 * @property string $field14
 * @property string $field15
 * @property string $field16
 * @property string $field17
 * @property string $field18
 * @property integer $status
 * @property integer $user_id
 * @property string $user_name
 * @property integer $order_id
 * @property string $created_at
 * @property string $updated_at
 */
class CaiwuExcelT extends \common\models\Base
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'caiwu_excel_t';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['import_id'], 'required'],
            [['import_id', 'status', 'user_id', 'order_id'], 'integer'],
            [['created_at', 'updated_at'], 'safe'],
            [['field0', 'field1', 'field2', 'field3', 'field4', 'field5', 'field6', 'field7', 'field8', 'field9', 'field10', 'field11', 'field12', 'field13', 'field14', 'field15', 'field16', 'field17', 'field18'], 'string', 'max' => 100],
            [['user_name'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'import_id' => 'Import ID',
            'field0' => 'Field0',
            'field1' => 'Field1',
            'field2' => 'Field2',
            'field3' => 'Field3',
            'field4' => 'Field4',
            'field5' => 'Field5',
            'field6' => 'Field6',
            'field7' => 'Field7',
            'field8' => 'Field8',
            'field9' => 'Field9',
            'field10' => 'Field10',
            'field11' => 'Field11',
            'field12' => 'Field12',
            'field13' => 'Field13',
            'field14' => 'Field14',
            'field15' => 'Field15',
            'field16' => 'Field16',
            'field17' => 'Field17',
            'field18' => 'Field18',
            'status' => 'Status',
            'user_id' => 'User ID',
            'user_name' => 'User Name',
            'order_id' => 'Order ID',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

    public function getOrder()
    {
        return $this->hasOne(OrderT::className(),['id'=>'order_id']);
    }

    public function getUser()
    {
        return $this->hasOne(UserT::className(),['id'=>'user_id']);
    }
}
