<?php

namespace App\Modelos;

use Core\Database;

class Almacenes extends Database
{
    protected $table = 'app_almacenes';
    protected $id = 'alm_id';

    public function chequearForanea($id_alamcen)
    {
        return $this->consultar("SELECT * FROM app_almacenes a JOIN app_productos_stocks ps ON a.alm_id = ps.ps_almid WHERE a.alm_id = $id_alamcen")->row();
    }

    public function almacenesActivas()
    {
        return $this->consultar("SELECT * FROM app_almacenes  WHERE alm_eliminado = 0")->all();
    }
}
