Przeglądaj źródła

exportar fecha como campo fecha de excel

Nermosis 3 lat temu
rodzic
commit
183b133473

+ 10 - 6
application/controllers/ExportXls.php Wyświetl plik

123
         foreach ($licitacionesResult['datos'] as $licitacion) {
123
         foreach ($licitacionesResult['datos'] as $licitacion) {
124
             $result[$licitacion->id_licitacion]['licitacion'] = array(
124
             $result[$licitacion->id_licitacion]['licitacion'] = array(
125
                 'id_licitacion' => $licitacion->id_licitacion,
125
                 'id_licitacion' => $licitacion->id_licitacion,
126
-                "url_id_licitacion" => $licitacion->url_id_licitacion,
126
+                "link_uri" => $licitacion->link_uri,
127
                 "updated" => $licitacion->updated,
127
                 "updated" => $licitacion->updated,
128
             );
128
             );
129
             $result[$licitacion->id_licitacion]['contract'] = array(
129
             $result[$licitacion->id_licitacion]['contract'] = array(
211
                 "size" => 13,
211
                 "size" => 13,
212
             ),
212
             ),
213
         );
213
         );
214
+        $updatedFormat = new DateTime($datosLicitacion['licitacion']['updated']);
215
+        $updated = \PhpOffice\PhpSpreadsheet\Shared\Date::PHPToExcel($updatedFormat);
214
         $sheet->getStyle("A1:AB1")->applyFromArray($styleArr);
216
         $sheet->getStyle("A1:AB1")->applyFromArray($styleArr);
215
         $sheet->setCellValue('A' . $filaExcel, $datosLicitacion['licitacion']['id_licitacion']);
217
         $sheet->setCellValue('A' . $filaExcel, $datosLicitacion['licitacion']['id_licitacion']);
216
-        $sheet->setCellValue('B' . $filaExcel, $datosLicitacion['licitacion']['url_id_licitacion']);
217
-        $sheet->setCellValue('C' . $filaExcel, $datosLicitacion['licitacion']['updated']);
218
-        $sheet->setCellValue('D' . $filaExcel, );
218
+        $sheet->setCellValue('B' . $filaExcel, $datosLicitacion['licitacion']['link_uri']);
219
+        $sheet->setCellValue('C' . $filaExcel, $updated);
220
+        $sheet->getStyle('C' . $filaExcel)
221
+            ->getNumberFormat()
222
+            ->setFormatCode(\PhpOffice\PhpSpreadsheet\Style\NumberFormat::FORMAT_DATE_DATETIME);
219
         $sheet->setCellValue('E' . $filaExcel, "");
223
         $sheet->setCellValue('E' . $filaExcel, "");
220
         $sheet->setCellValue('F' . $filaExcel, $datosLicitacion['contract']['descripcion']);
224
         $sheet->setCellValue('F' . $filaExcel, $datosLicitacion['contract']['descripcion']);
221
         $sheet->setCellValue('G' . $filaExcel, $datosLicitacion['contract']['contractFolderID']);
225
         $sheet->setCellValue('G' . $filaExcel, $datosLicitacion['contract']['contractFolderID']);
239
         $sheet->setCellValue('M' . $filaExcel, $datosLicitacion['project']['tipo_contrato']);
243
         $sheet->setCellValue('M' . $filaExcel, $datosLicitacion['project']['tipo_contrato']);
240
         $sheet->setCellValue('N' . $filaExcel, $datosLicitacion['project']['countrySubentityCode'] . " - " . $datosLicitacion['project']['countrySubentity']);
244
         $sheet->setCellValue('N' . $filaExcel, $datosLicitacion['project']['countrySubentityCode'] . " - " . $datosLicitacion['project']['countrySubentity']);
241
         $sheet->setCellValue('O' . $filaExcel, $datosLicitacion['party']['partyName']);
245
         $sheet->setCellValue('O' . $filaExcel, $datosLicitacion['party']['partyName']);
242
-        $sheet->setCellValue('P' . $filaExcel, $datosLicitacion['locatedParty']['partyName']);
246
+        $sheet->setCellValue('P' . $filaExcel, "");
243
         $sheet->setCellValue('Q' . $filaExcel, $datosLicitacion['locatedParty']['contractingPartyTypeCode']);
247
         $sheet->setCellValue('Q' . $filaExcel, $datosLicitacion['locatedParty']['contractingPartyTypeCode']);
244
         $sheet->setCellValue('R' . $filaExcel, ""); //$cpvParty);
248
         $sheet->setCellValue('R' . $filaExcel, ""); //$cpvParty);
245
         $sheet->setCellValue('S' . $filaExcel, $datosLicitacion['locatedParty']['buyerProfileURIID']); //Buscar DIR3
249
         $sheet->setCellValue('S' . $filaExcel, $datosLicitacion['locatedParty']['buyerProfileURIID']); //Buscar DIR3
248
         $sheet->setCellValue('V' . $filaExcel, $datosLicitacion['tenderProcess']['tipoTender']);
252
         $sheet->setCellValue('V' . $filaExcel, $datosLicitacion['tenderProcess']['tipoTender']);
249
         $sheet->setCellValue('W' . $filaExcel, $datosLicitacion['tenderProcess']['contrato_sistema']);
253
         $sheet->setCellValue('W' . $filaExcel, $datosLicitacion['tenderProcess']['contrato_sistema']);
250
         $sheet->setCellValue('X' . $filaExcel, $datosLicitacion['tenderProcess']['urgency']);
254
         $sheet->setCellValue('X' . $filaExcel, $datosLicitacion['tenderProcess']['urgency']);
251
-        $sheet->setCellValue('Y' . $filaExcel, $datosLicitacion['tenderProcess']['submission']);
255
+        $sheet->setCellValue('Y' . $filaExcel, $datosLicitacion['tenderProcess']['submision']);
252
         $sheet->setCellValue('Z' . $filaExcel, $datosLicitacion['tenderTerms']['procurementLegislationDocumentReference']);
256
         $sheet->setCellValue('Z' . $filaExcel, $datosLicitacion['tenderTerms']['procurementLegislationDocumentReference']);
253
         $sheet->setCellValue('AA' . $filaExcel, $datosLicitacion['tenderTerms']['allowedSubcontractTerms']);
257
         $sheet->setCellValue('AA' . $filaExcel, $datosLicitacion['tenderTerms']['allowedSubcontractTerms']);
254
         $sheet->setCellValue('AB' . $filaExcel, $datosLicitacion['project']['durationMesure']);
258
         $sheet->setCellValue('AB' . $filaExcel, $datosLicitacion['project']['durationMesure']);

+ 6 - 3
application/models/Xlsexport_model.php Wyświetl plik

35
                     CF.id,
35
                     CF.id,
36
                     LI.id_licitacion,
36
                     LI.id_licitacion,
37
                     GROUP_CONCAT( PROJI.itemClassification_value ) AS itemClassification_attr,
37
                     GROUP_CONCAT( PROJI.itemClassification_value ) AS itemClassification_attr,
38
-                    LI.url_id_licitacion,
38
+                    LI.link_uri,
39
                     LI.updated,
39
                     LI.updated,
40
                     CF.contractFolderID,
40
                     CF.contractFolderID,
41
+                    CF.contractFolderStatusCode,
41
                     LP.buyerProfileURIID,
42
                     LP.buyerProfileURIID,
43
+                    LP.contractingPartyTypeCode,
42
                     MP.partyName,
44
                     MP.partyName,
43
                     MP.codpostal,
45
                     MP.codpostal,
44
                     MP.websiteURI,
46
                     MP.websiteURI,
46
                     MP.direccion,
48
                     MP.direccion,
47
                     MP.contact_name,
49
                     MP.contact_name,
48
                     MP.contact_email,
50
                     MP.contact_email,
49
-                    PROJ.NAME,
51
+                    PROJ.NAME as name,
50
                     PROJ.estimatedOverallContractAmount,
52
                     PROJ.estimatedOverallContractAmount,
51
                     PROJ.taxExclusiveAmount,
53
                     PROJ.taxExclusiveAmount,
52
                     PROJ.totalAmount,
54
                     PROJ.totalAmount,
68
                     RTPU.nombre AS urgency,
70
                     RTPU.nombre AS urgency,
69
                     LI.fecha_creacion_log
71
                     LI.fecha_creacion_log
70
                 FROM
72
                 FROM
71
-                    maestro_datos_iniciales_licitacion LI /*JOIN import_licitaciones_temp temp ON LI.id_licitacion = temp.id_licitacion*/
73
+                    maestro_datos_iniciales_licitacion LI
74
+                    JOIN import_licitaciones_temp temp ON LI.id_licitacion = temp.id_licitacion
72
                     LEFT JOIN maestro_contract_folder CF ON CF.id_ajena_licitacion = LI.id_licitacion
75
                     LEFT JOIN maestro_contract_folder CF ON CF.id_ajena_licitacion = LI.id_licitacion
73
                     LEFT JOIN maestro_located_contracting_party LP ON LP.id_ajena_licitacion = LI.id_licitacion
76
                     LEFT JOIN maestro_located_contracting_party LP ON LP.id_ajena_licitacion = LI.id_licitacion
74
                     LEFT JOIN maestro_party MP ON MP.id_ajena_licitacion = LI.id_licitacion
77
                     LEFT JOIN maestro_party MP ON MP.id_ajena_licitacion = LI.id_licitacion