<?php

namespace App\Modelos;

use Core\Database;

class Tarifas extends Database
{
    protected $table = 'app_tarifas';
    protected $id = 'tar_id';

    public function obtenerTarifas()
    {
        return $this->consultar("SELECT * FROM app_tarifas")->all();
    }

    public function obtenerTarifasProductos($prod_id)
    {
        return $this->consultar("SELECT * FROM app_productos_tarifas pt
        INNER JOIN app_productos p ON p.pro_id=pt.pt_proid
        INNER JOIN app_tarifas t ON t.tar_id=pt.pt_tarid
        WHERE pt.pt_proid=$prod_id")->all();
    }
}
