Import Precios

This commit is contained in:
Juan Pablo Vial
2025-08-27 19:27:18 -04:00
parent 4e4c0b7648
commit ad64ffa436
19 changed files with 1049 additions and 21 deletions

View File

@ -7,6 +7,8 @@ use Incoviba\Common\Define;
use Incoviba\Common\Implement;
use Incoviba\Model;
use Incoviba\Repository;
use PDO;
use PDOException;
class EstadoPrecio extends Ideal\Repository
{
@ -44,11 +46,24 @@ class EstadoPrecio extends Ideal\Repository
return $this->update($model, ['precio', 'estado', 'fecha'], $new_data);
}
/**
* @param int $precio_id
* @return array
* @throws Implement\Exception\EmptyResult
*/
public function fetchByPrecio(int $precio_id): array
{
$query = "SELECT * FROM `{$this->getTable()}` WHERE `precio` = ?";
error_log($query.PHP_EOL,3,'/logs/query.log');
error_log($precio_id.PHP_EOL,3,'/logs/query.log');
return $this->fetchMany($query, [$precio_id]);
}
/**
* @param int $precio_id
* @return Define\Model
* @throws Implement\Exception\EmptyResult
*/
public function fetchCurrentByPrecio(int $precio_id): Define\Model
{
$query = "SELECT e1.*