<?php

namespace App\Modelos;

use Core\Database;

class PlanillaPreOrdenPartes extends Database
{
    protected $table = 'app_preorden_master_partes';
    protected $id = 'prepar_id';

    public function obtenerPartes(int $id_preorden)
    {
        return $this->consultar("SELECT * 
        FROM app_preorden_master_partes par
        JOIN app_planillas_categorias_partes p ON p.par_id = par.prepar_parid
        JOIN app_planilla_categorias c ON c.cat_id = p.par_catid
        WHERE prepar_preid = $id_preorden")->all();
    }
}
