<?php

namespace App\Modelos;

use Core\Database;

class ClienteContactos extends Database
{
    protected $table    = 'app_clientes_contactos';
    protected $id       = 'ccon_id';

    public function obtenerContactos(int $id_cliente)
    {
        return $this->consultar("SELECT ccon_id id, ccon_nombre nombre, ccon_cargo cargo
        FROM app_clientes_contactos 
        WHERE ccon_cliid = $id_cliente")->all();
    }

    public function obtenerClientestxt()
    {
        return $this->consultar('SELECT * FROM app_clientes ac 
        JOIN app_clientes_contactos tp ON tp.ccon_cliid = ac.cli_id')->all();
    }
}
