<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "gz2_t".
 *
 * @property integer $id
 * @property integer $sale_id
 * @property integer $year
 * @property integer $month
 * @property integer $send_count
 * @property integer $send_count2
 * @property string $price
 * @property string $base_money
 * @property string $phone_money
 * @property string $other_money
 * @property string $pay_money
 * @property string $created_at
 * @property string $updated_at
 */
class Gz2T extends \common\models\Base
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'gz2_t';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['sale_id'], 'required'],
            [['sale_id', 'year', 'month', 'send_count', 'send_count2'], 'integer'],
            [['price', 'base_money', 'phone_money', 'other_money', 'pay_money'], 'number'],
            [['created_at', 'updated_at'], 'safe'],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'sale_id' => 'Sale ID',
            'year' => 'Year',
            'month' => 'Month',
            'send_count' => 'Send Count',
            'send_count2' => 'Send Count2',
            'price' => 'Price',
            'base_money' => 'Base Money',
            'phone_money' => 'Phone Money',
            'other_money' => 'Other Money',
            'pay_money' => 'Pay Money',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }

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