<?php

namespace App\Modelos;

use Core\Database;

class Banco extends Database
{
    protected $table = 'app_bancos';
    protected $id = 'ban_id';

    public function bancos()
    {
        return $this->consultar('SELECT ban_id, ban_codigo, ban_descripcion, ban_paid, ban_estatus, pa_nombre FROM app_bancos JOIN app_paises ON pa_id=ban_paid')->all();
    }

    public function bancosActivos()
    {
        return $this->consultar('SELECT ban_id, ban_codigo, ban_descripcion, ban_paid, ban_estatus, pa_nombre FROM app_bancos JOIN app_paises ON pa_id=ban_paid WHERE ban_estatus=1')->all();
    }

    public function bancoForaneo($id)
    {
        return $this->consultar("SELECT * FROM app_bancos_cuentas WHERE bc_banid=$id")->row();
    }
}
