<?php

namespace App\Danoral\Cobranzas\Cobros;

use App\Danoral\ModelBase;
use Illuminate\Support\Facades\DB;

/**
 *      123456789012345678
 *      100100000000000001
 *      876543210987654321
 */

class CobrosLista extends ModelBase
{
    protected $tableName = 'cobros_listas';
    protected $primaryKey = 'idCobrosLista';
    public $incrementing = true;
    public $timestamps = false;

    protected $fillable = [
        'dateCobrosLista',
        'idEUser',
        'typeCobrosLista',
        'dateCobro'
    ];

    function __construct($anoSchema = null) {
        if(is_null($anoSchema)){
            $this->table = parent::$SCHEMA .'.'. $this->tableName;
        }else{
            parent::getSchema_ano($anoSchema);
        }
    }

    static function getCobrosListasView() {
        return CobrosLista::orderBy('dateCobrosLista', 'asc')->get();
    }
}