<?php

namespace backend\models;

use Yii;

/**
 * This is the model class for table "crm_mt4_deposit_log".
 *
 * @property integer $id
 * @property integer $type
 * @property integer $mt4_id
 * @property string $order_id
 * @property string $mt4_order_id
 * @property string $usd_money
 * @property string $err_code
 * @property string $err_msg
 * @property integer $create_time
 */
class Mt4DepositLog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'crm_mt4_deposit_log';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('dbXcrm');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['type', 'mt4_id', 'create_time'], 'integer'],
            [['usd_money'], 'number'],
            [['create_time'], 'required'],
            [['order_id', 'mt4_order_id'], 'string', 'max' => 32],
            [['err_code'], 'string', 'max' => 16],
            [['err_msg'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => '自增ID',
            'type' => '类型 1入金 2出金',
            'mt4_id' => 'mt4 id',
            'order_id' => '订单号',
            'mt4_order_id' => 'mt4订单号',
            'usd_money' => '操作金额 美元',
            'err_code' => '错误码',
            'err_msg' => '错误信息',
            'create_time' => '创建时间',
        ];
    }
}
