DelayAnalysisController.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. namespace App\Http\Controllers;
  3. use App\Http\Controllers\ResponseController;
  4. use App\Http\Controllers\EncryptionController;
  5. use App\Http\Controllers\ResourcesController;
  6. use Illuminate\Http\Request;
  7. use Illuminate\Support\Carbon;
  8. use Illuminate\Support\Facades\DB;
  9. use Illuminate\Support\Facades\Validator;
  10. class DelayAnalysisController extends Controller
  11. {
  12. private $responseController;
  13. private $encController;
  14. private $resourcesController;
  15. public function __construct(){
  16. $this->responseController = new ResponseController();
  17. $this->encController = new EncryptionController();
  18. $this->resourcesController = new ResourcesController();
  19. }
  20. public function registerDelayAnalysis() {
  21. }
  22. public function getDelayAnalysis($line) {
  23. try {
  24. $getDelayAnalysis = DB::table('S002V01TANRE')
  25. ->where('ANRE_NULI', '=', $line)
  26. ->join('S002V01TORCO', 'ORCO_NUOR', '=', 'ANRE_NUOR')
  27. ->join('S002V01TPROV', 'PROV_NUPR', '=', 'ORCO_NUPR')
  28. ->get([
  29. 'ANRE_IDAR',
  30. 'ANRE_NUOR',
  31. 'ANRE_DESC',
  32. 'ANRE_TIPO',
  33. 'ANRE_FEEN',
  34. 'ANRE_ESTA',
  35. 'ANRE_USRE',
  36. 'ANRE_FERE',
  37. 'ANRE_USMO',
  38. 'ANRE_FEMO',
  39. 'ORCO_NUOR',
  40. 'ORCO_NUPR',
  41. 'ORCO_NUDE',
  42. 'ORCO_IDLI',
  43. 'ORCO_MONE',
  44. 'ORCO_COST',
  45. 'ORCO_PROP',
  46. 'ORCO_ACTI',
  47. 'ORCO_PROY',
  48. 'PROV_NUPR',
  49. 'PROV_NOCO',
  50. 'PROV_NOMB',
  51. 'PROV_APPA',
  52. 'PROV_APMA',
  53. 'PROV_CORR',
  54. 'PROV_LAD1',
  55. 'PROV_TEL1',
  56. 'PROV_LAD2',
  57. 'PROV_TEL2',
  58. 'PROV_XRFC',
  59. 'PROV_XTAX',
  60. 'PROV_GIRO',
  61. 'PROV_TIPO',
  62. 'PROV_SIWE',
  63. 'PROV_MEPA',
  64. ]);
  65. } catch (\Throwable $th) {
  66. return $this->responseController->makeResponse(true, "ERR_DELAY_ANALYSIS_GET000: Ocurrió un error al momento de obtener los registros", $th->getMessage(), 500);
  67. }
  68. return $this->responseController->makeResponse(false, "ÉXITO: Consulta Exitosa", $getDelayAnalysis);
  69. }
  70. }