<?php 

namespace backend\models;

use Yii;

/**
 * This is the model class for table "crm_ib_open_record".
 *
 * @property string $id
 * @property integer $ref_id
 * @property integer $open_id
 * @property double $forex
 * @property double $metal
 * @property double $hk_fifty
 * @property double $btc
 * @property double $cfd
 * @property double $gold
 * @property double $silver
 * @property double $wy
 * @property string $bank_name
 * @property string $bank_province
 * @property string $bank_city
 * @property string $bank_district
 * @property string $bank_branch
 * @property string $bank_card_no
 * @property string $collect_name
 * @property string $bank_swift_code
 * @property string $in_time
 */
class IbOpenRecord extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'crm_ib_open_record';
    }

    /**
     * @inheritdoc
     */
    public static function getDb()
    {
        return Yii::$app->get('dbXcrm');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['open_id', 'ref_id'], 'required'],
            [['open_id', 'ref_id', 'in_time'], 'integer'],
            [['bank_name', 'bank_branch', 'bank_card_no', 'collect_name', 'bank_swift_code'], 'string', 'max' => 32],
            [['bank_province', 'bank_city', 'bank_district'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'ref_id' => 'Ref ID',
            'open_id' => 'Open ID',
            'bank_name' => 'Bank Name',
            'bank_province' => 'Bank Province',
            'bank_city' => 'Bank City',
            'bank_district' => 'Bank District',
            'bank_branch' => 'Bank Branch',
            'bank_card_no' => 'Bank Card No',
            'collect_name' => 'Collect Name',
            'bank_swift_code' => 'Bank Swift Code',
            'in_time' => 'In Time',
        ];
    }
}
