From 8eea27060ac52677d37a1391285b07360de05ee4 Mon Sep 17 00:00:00 2001 From: Djonathan Date: Wed, 20 Jul 2022 10:11:45 -0300 Subject: [PATCH] Correction of PLD implementation, Daily Values. --- app/Repositories/Pld/PldRepository.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/Repositories/Pld/PldRepository.php b/app/Repositories/Pld/PldRepository.php index 8f785f9..0057b05 100644 --- a/app/Repositories/Pld/PldRepository.php +++ b/app/Repositories/Pld/PldRepository.php @@ -159,8 +159,7 @@ class PldRepository extends AbstractRepository implements PldContractInterface 'pld.submercado as submarket', DB::raw("AVG(pld.valor) as value"), DB::raw("pld.mes_ref as year_month"), - DB::raw("TO_CHAR(TO_DATE(pld.mes_ref, 'YYMM'::text)::timestamp with time zone, 'MM/YYYY'::text) as year_month_formatted"), - DB::raw("TO_CHAR(TO_DATE(pld.mes_ref, 'YYMM'), 'MM/YYYY') AS mes_ref"), + DB::raw("TO_CHAR(TO_DATE(pld.mes_ref, 'YYMM'::text)::timestamp with time zone, 'MM/YYYY'::text) as year_month_formatted") ]; $fields2 = ['day_formatted', @@ -182,10 +181,8 @@ class PldRepository extends AbstractRepository implements PldContractInterface ) ->orderByRaw("('1899-12-30'::date + ('1 day'::interval day * (pld.dia_num)::double precision))"); - return $this->execute($fields2, $params) ->from($query, 'plds') - ->orderBy('day_calc', 'asc') ->get(); }