Pārlūkot izejas kodu

Upgrade phpexcel to phpspreadsheet php 7.4

Christian 3 gadus atpakaļ
vecāks
revīzija
3fb36cb5f2
3 mainītis faili ar 537 papildinājumiem un 443 dzēšanām
  1. 1 0
      .gitignore
  2. 471 432
      application/controllers/ExportXls.php
  3. 65 11
      application/models/Xlsexport_model.php

+ 1 - 0
.gitignore Parādīt failu

35
 uploads/
35
 uploads/
36
 application/config/database.php
36
 application/config/database.php
37
 application/libraries/ParserDatabaseBruto1.php
37
 application/libraries/ParserDatabaseBruto1.php
38
+.vscode/launch.json123

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 471 - 432
application/controllers/ExportXls.php


+ 65 - 11
application/models/Xlsexport_model.php Parādīt failu

29
     // ------------------------------------------------------------------------
29
     // ------------------------------------------------------------------------
30
 
30
 
31
     // ------------------------------------------------------------------------
31
     // ------------------------------------------------------------------------
32
-    public function getLicitaciones()
32
+    public function getLicitaciones($having = "")
33
     {
33
     {
34
-        $sql = "SELECT *
34
+        $sql = "SELECT
35
+                    CF.id,
36
+                    LI.id_licitacion,
37
+                    GROUP_CONCAT( PROJI.itemClassification_value ) AS itemClassification_attr,
38
+                    LI.url_id_licitacion,
39
+                    LI.updated,
40
+                    CF.contractFolderID,
41
+                    LP.buyerProfileURIID,
42
+                    MP.partyName,
43
+                    MP.codpostal,
44
+                    MP.websiteURI,
45
+                    MP.city,
46
+                    MP.direccion,
47
+                    MP.contact_name,
48
+                    MP.contact_email,
49
+                    PROJ.NAME,
50
+                    PROJ.estimatedOverallContractAmount,
51
+                    PROJ.taxExclusiveAmount,
52
+                    PROJ.totalAmount,
53
+                    PROJ.countrySubentityCode,
54
+                    PROJ.countrySubentity,
55
+                    PROJ.durationMesure,
56
+                    PROJ.medida,
57
+                    PROJ.duracion_inicio,
58
+                    PROJ.duracion_fin,
59
+                    PROJ.contractExtension,
60
+                    TT.procurementLegislationDocumentReference,
61
+                    TT.allowedSubcontractTerms,
62
+                    RCF.descripcion AS contrato_status,
63
+                    RLP.nombre AS tipo_administracion,
64
+                    TPC.descripcion AS tipo_contrato,
65
+                    RTP.nombre AS tipoTender,
66
+                    RTPC.nombre AS contrato_sistema,
67
+                    RTPS.nombre AS submision,
68
+                    RTPU.nombre AS urgency,
69
+                    LI.fecha_creacion_log
35
                 FROM
70
                 FROM
36
-                    maestro_datos_iniciales_licitacion li
37
-                    /*WHERE updated >= '2022-01-24 00:00:00' AND updated <= '2022-01-30 23:59:00'*/
38
-                    WHERE id < 100";
71
+                    maestro_datos_iniciales_licitacion LI /*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
73
+                    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
75
+                    LEFT JOIN maestro_procurement_project PROJ ON PROJ.id_ajena_licitacion = LI.id_licitacion
76
+                    LEFT JOIN maestro_procurement_project_itemclass PROJI ON PROJI.id_ajena_licitacion = LI.id_licitacion
77
+                    LEFT JOIN maestro_tendering_process TP ON TP.id_ajena_licitacion = LI.id_licitacion
78
+                    LEFT JOIN maestro_tendering_terms TT ON TT.id_ajena_licitacion = LI.id_licitacion
79
+                    LEFT JOIN relacionada_contract_status RCF ON RCF.CODE = CF.contractFolderStatusCode
80
+                    LEFT JOIN relacionada_located_contracting_party RLP ON RLP.CODE = LP.contractingPartyTypeCode
81
+                    LEFT JOIN relacionada_tipo_contrato TPC ON TPC.CODE = PROJ.typeCode
82
+                    LEFT JOIN relacionada_tender_process RTP ON RTP.CODE = TP.procedureCode
83
+                    LEFT JOIN relacionada_tender_process_contracting_code RTPC ON RTPC.CODE = TP.contractingSystemCode
84
+                    LEFT JOIN relacionada_tender_process_submission RTPS ON RTPS.CODE = TP.submissionMethodCode
85
+                    LEFT JOIN relacionada_tender_process_urgency_code RTPU ON RTPU.CODE = TP.urgencyCode /*WHERE
86
+                LI.id < 17174 */
87
+
88
+                GROUP BY
89
+                    id_licitacion
90
+                $having
91
+                ORDER BY
92
+                    CF.id";
39
         $result = $this->db->query($sql);
93
         $result = $this->db->query($sql);
40
         $datos['datos'] = $result->result();
94
         $datos['datos'] = $result->result();
41
         $datos['num_rows'] = $result->num_rows();
95
         $datos['num_rows'] = $result->num_rows();
53
         $datos['num_rows'] = $result->num_rows();
107
         $datos['num_rows'] = $result->num_rows();
54
         return $datos['datos'];
108
         return $datos['datos'];
55
     }
109
     }
56
-
57
     public function getTablaWithoutLicitacion($tabla)
110
     public function getTablaWithoutLicitacion($tabla)
58
     {
111
     {
59
         $sql = "SELECT
112
         $sql = "SELECT
66
         return $datos;
119
         return $datos;
67
     }
120
     }
68
 
121
 
69
-    public function getDatosRelacionadosByTablaAndLicitacion($tabla, $txtIdAjena, $idAjena)
122
+    public function getDatosRelacionadosByTablaAndLicitacion($tabla, $tablaAjena, $idRelacionada, $idAjenaLicitacion)
70
     {
123
     {
71
         $sql = "SELECT
124
         $sql = "SELECT
72
                     *
125
                     *
73
                 FROM
126
                 FROM
74
                     $tabla
127
                     $tabla
75
-                WHERE $txtIdAjena = $idAjena";
128
+                JOIN $tablaAjena TBAJ ON TBAJ.code = " . $tabla . "." . $idRelacionada . "
129
+                WHERE id_ajena_licitacion = $idAjenaLicitacion";
76
         $result = $this->db->query($sql);
130
         $result = $this->db->query($sql);
77
         $datos['datos'] = $result->result_array();
131
         $datos['datos'] = $result->result_array();
78
         $datos['num_rows'] = $result->num_rows();
132
         $datos['num_rows'] = $result->num_rows();
160
         t1.description
214
         t1.description
161
     FROM
215
     FROM
162
         maestro_tendering_terms_financial_evaluation t1
216
         maestro_tendering_terms_financial_evaluation t1
163
-        JOIN maestro_tendering_terms t2 ON t1.id_ajena_ttfe = t2.id
217
+        JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
164
         JOIN relacionada_tendering_terms_financial t3 ON t3.CODE = t1.evaluationCriteriaTypeCode";
218
         JOIN relacionada_tendering_terms_financial t3 ON t3.CODE = t1.evaluationCriteriaTypeCode";
165
 
219
 
166
         $result = $this->db->query($sql);
220
         $result = $this->db->query($sql);
175
                     t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
229
                     t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
176
                 FROM
230
                 FROM
177
                 maestro_tendering_terms_qualification_request t1
231
                 maestro_tendering_terms_qualification_request t1
178
-                JOIN maestro_tendering_terms t2 ON t1.id_ajena_tt = t2.id
232
+                JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
179
                 JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
233
                 JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
180
 
234
 
181
         $result = $this->db->query($sql);
235
         $result = $this->db->query($sql);
190
                     t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
244
                     t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
191
                 FROM
245
                 FROM
192
                 maestro_tendering_terms_qualification_request t1
246
                 maestro_tendering_terms_qualification_request t1
193
-                JOIN maestro_tendering_terms t2 ON t1.id_ajena_tt = t2.id
247
+                JOIN maestro_tendering_terms t2 ON t1.id_ajena_licitacion = t2.id
194
                 JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
248
                 JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
195
 
249
 
196
         $result = $this->db->query($sql);
250
         $result = $this->db->query($sql);