Parserdatabaselimpio.php 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. defined('BASEPATH') or exit('No direct script access allowed');
  3. class Parserdatabaselimpio
  4. {
  5. protected $CI;
  6. public function __construct()
  7. {
  8. $this->CI = &get_instance();
  9. $this->CI->load->model("Parser_model");
  10. }
  11. public function index()
  12. {
  13. $now = date("Y-m-d_H-i-s");
  14. $tablasInsert = $this->CI->Parser_model->getMapaTablas();
  15. if ($tablasInsert['num_rows'] > 0) {
  16. foreach ($tablasInsert['datos'] as $row) {
  17. $datosTablaToInsert = $this->CI->Parser_model->getDatosBrutos($row->tabla_sucia);
  18. if ($datosTablaToInsert['num_rows'] > 0) {
  19. if ($row->tabla_maestra == "maestro_datos_iniciales_licitacion") {
  20. foreach ($datosTablaToInsert['datos'] as $datos) {
  21. unset($datos->id);
  22. }
  23. }
  24. insertBucleDuplicateOnKey($datosTablaToInsert['datos'], $row->tabla_maestra, "brutoToMaestro_" . $now);
  25. }
  26. }
  27. }
  28. }
  29. }
  30. /* End of file Parserdatabaselimpio.php */
  31. /* Location: ./application/libraries/Parserdatabaselimpio.php */