<?php

namespace App\Danoral\Transacciones\sysOLD;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;

class ItemsDT extends Model
{
    public static $TYPE_230_PROVISION_DOLARES = 45;

    protected $connection = 'mysql_danoral';
    protected $table = 'itemsdt';
    protected $primaryKey = 'idDT';
    public $incrementing = false;
    public $timestamps = false;

    public $idDT;

    public function myInsert($data)
    {
        $idDT = DB::select('SELECT nextval(\'admin."old_itemsdt_idDT_seq"\'::regclass)');
        $this->idDT = $idDT[0]->nextval;

        echo 'idDT : ' . $this->idDT . PHP_EOL;

        $data['idDT'] = $this->idDT;

        print_r($data);

        DB::connection('mysql_danoral')
            ->table('itemsdt')->insert($data);

    }



}
