✏️ 正在编辑: ScrapingBradesco.php
路径:
/srv/systems_dir/yuppiecred-lidernegocios/library/Core/Banco/Service/ScrapingBradesco.php
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
<?php class Core_Banco_Service_ScrapingBradesco implements Core_Banco_Service_ImportacaoDireta { private $_usuario; private $_senha; private $_bancoId; private $_erros; public function __construct($config, $bancoNome) { $this->_bancoId = Model_Banco::bancoPorNome($bancoNome); if(empty($this->_bancoId)){ throw new Yuppie_Exception("O banco Bradesco não foi configurado"); } $this->_usuario = $config->usuario; $this->_senha = $config->senha; $this->_erros = array(); } function getErros() { return $this->_erros; } public function importar($dataImportacao = null) { $command = escapeshellcmd("python " . dirname(__FILE__) . "/Scraping/YuppieScrap.py " . "$this->_usuario $this->_senha"); $output = shell_exec($command); if( $output ){ $lines = explode(PHP_EOL, $output); $array = array(); foreach ( $lines as $line ) { $line = str_replace("\r", "", $line); $colunas = explode(";", $line); $i = "A"; $values = array(); foreach ( $colunas as $col ) { $values[$i++] = trim($col); } $values = array_filter($values); if( count($values) > 0 ){ $array[] = $values; } } unset($array[0]); $array = array_filter($array); foreach ( $array as $key => &$values ) { if( empty($values["G"]) ){ $values["G"] = $values["H"]; } } $bradescoProd = new Core_Banco_Planilha_Bradesco_Scraping($this->_bancoId); return $bradescoProd->importar($array); } return; } }
💾 保存文件
← 返回文件管理器