|
@@ -29,13 +29,67 @@ class Xlsexport_model extends CI_Model
|
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
|
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
|
93
|
$result = $this->db->query($sql);
|
40
|
94
|
$datos['datos'] = $result->result();
|
41
|
95
|
$datos['num_rows'] = $result->num_rows();
|
|
@@ -53,7 +107,6 @@ class Xlsexport_model extends CI_Model
|
53
|
107
|
$datos['num_rows'] = $result->num_rows();
|
54
|
108
|
return $datos['datos'];
|
55
|
109
|
}
|
56
|
|
-
|
57
|
110
|
public function getTablaWithoutLicitacion($tabla)
|
58
|
111
|
{
|
59
|
112
|
$sql = "SELECT
|
|
@@ -66,13 +119,14 @@ class Xlsexport_model extends CI_Model
|
66
|
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
|
124
|
$sql = "SELECT
|
72
|
125
|
*
|
73
|
126
|
FROM
|
74
|
127
|
$tabla
|
75
|
|
- WHERE $txtIdAjena = $idAjena";
|
|
128
|
+ JOIN $tablaAjena TBAJ ON TBAJ.code = " . $tabla . "." . $idRelacionada . "
|
|
129
|
+ WHERE id_ajena_licitacion = $idAjenaLicitacion";
|
76
|
130
|
$result = $this->db->query($sql);
|
77
|
131
|
$datos['datos'] = $result->result_array();
|
78
|
132
|
$datos['num_rows'] = $result->num_rows();
|
|
@@ -160,7 +214,7 @@ class Xlsexport_model extends CI_Model
|
160
|
214
|
t1.description
|
161
|
215
|
FROM
|
162
|
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
|
218
|
JOIN relacionada_tendering_terms_financial t3 ON t3.CODE = t1.evaluationCriteriaTypeCode";
|
165
|
219
|
|
166
|
220
|
$result = $this->db->query($sql);
|
|
@@ -175,7 +229,7 @@ class Xlsexport_model extends CI_Model
|
175
|
229
|
t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
|
176
|
230
|
FROM
|
177
|
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
|
233
|
JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
|
180
|
234
|
|
181
|
235
|
$result = $this->db->query($sql);
|
|
@@ -190,7 +244,7 @@ class Xlsexport_model extends CI_Model
|
190
|
244
|
t2.id_ajena_licitacion, t3.nombre as evaluationCriteriaTypeCode, t1.description
|
191
|
245
|
FROM
|
192
|
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
|
248
|
JOIN relacionada_tendering_terms_qualification_request t3 ON t3.code = t1.evaluationCriteriaTypeCode";
|
195
|
249
|
|
196
|
250
|
$result = $this->db->query($sql);
|