Commit 5fdf8e8b authored by Ana's avatar Ana

resolviendo conflictos

parent 18d8efbe
...@@ -176,23 +176,6 @@ ...@@ -176,23 +176,6 @@
<parameter name="Engine" value="InnoDB"/> <parameter name="Engine" value="InnoDB"/>
</vendor> </vendor>
</table> </table>
<table name="mcafee_ultimo_proceso_creacion" phpName="McafeeUltimoProcesoCreacion" idMethod="native">
<column name="muc_id" phpName="MucId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="ultimo_umn_id" phpName="UltimoUmnId" type="INTEGER" required="false"/>
<column name="muc_cantidad_procesados" phpName="MucCantidadProcesados" type="INTEGER" required="false"/>
<column name="muc_cantidad_pendientes" phpName="MucCantidadPendientes" type="INTEGER" required="false"/>
<column name="created_at" phpName="CreatedAt" type="TIMESTAMP" required="false"/>
<column name="updated_at" phpName="UpdatedAt" type="TIMESTAMP" required="false"/>
<foreign-key foreignTable="usuarios_mcafee_movistar_nuevos" name="fk_idx_usuario_movistar_nuevo" onDelete="RESTRICT" onUpdate="RESTRICT">
<reference local="ultimo_umn_id" foreign="id"/>
</foreign-key>
<index name="fk_idx_usuario_movistar_nuevo_idx">
<index-column name="ultimo_umn_id"/>
</index>
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="mcafee_ultimo_proceso_migracion" phpName="McafeeUltimoProcesoMigracion" idMethod="native"> <table name="mcafee_ultimo_proceso_migracion" phpName="McafeeUltimoProcesoMigracion" idMethod="native">
<column name="mup_id" phpName="MupId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/> <column name="mup_id" phpName="MupId" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="ultimo_umc_id" phpName="UltimoUmcId" type="INTEGER" required="true"/> <column name="ultimo_umc_id" phpName="UltimoUmcId" type="INTEGER" required="true"/>
...@@ -345,12 +328,6 @@ ...@@ -345,12 +328,6 @@
<index name="indice_umc_movistar_any"> <index name="indice_umc_movistar_any">
<index-column name="umc_movistar_any"/> <index-column name="umc_movistar_any"/>
</index> </index>
<index name="indice_fecha_creacion">
<index-column name="created_at"/>
</index>
<index name="indice_mcafee_mail">
<index-column name="umc_mcafee_email"/>
</index>
<vendor type="mysql"> <vendor type="mysql">
<parameter name="Engine" value="InnoDB"/> <parameter name="Engine" value="InnoDB"/>
</vendor> </vendor>
...@@ -392,35 +369,6 @@ ...@@ -392,35 +369,6 @@
<index name="ccid"> <index name="ccid">
<index-column name="Ccid"/> <index-column name="Ccid"/>
</index> </index>
<index name="correo">
<index-column name="Email_Address"/>
</index>
<index name="activty">
<index-column name="License_Activity"/>
</index>
<index name="tipo">
<index-column name="Device_Type"/>
</index>
<vendor type="mysql">
<parameter name="Engine" value="InnoDB"/>
</vendor>
</table>
<table name="usuarios_mcafee_movistar_nuevos" phpName="UsuariosMcafeeMovistarNuevos" idMethod="native">
<column name="id" phpName="Id" type="INTEGER" primaryKey="true" autoIncrement="true" required="true"/>
<column name="id_mov" phpName="IdMov" type="INTEGER" required="true" defaultValue="0"/>
<column name="area_tel" phpName="AreaTel" type="INTEGER" required="false"/>
<column name="rut" phpName="Rut" type="INTEGER" required="false"/>
<column name="nombres" phpName="Nombres" type="VARCHAR" size="45" required="false"/>
<column name="correo" phpName="Correo" type="VARCHAR" size="64" required="false"/>
<column name="fono_contacto_fijo_1" phpName="FonoContactoFijo1" type="INTEGER" required="false"/>
<column name="fono_contacto_fijo_2" phpName="FonoContactoFijo2" type="INTEGER" required="false"/>
<column name="fono_contacto_movil_1" phpName="FonoContactoMovil1" type="INTEGER" required="false"/>
<column name="fono_contacto_movil_2" phpName="FonoContactoMovil2" type="INTEGER" required="false"/>
<column name="ps_6094" phpName="Ps6094" type="INTEGER" required="false"/>
<column name="ps_5679" phpName="Ps5679" type="INTEGER" required="false"/>
<column name="ps_2989" phpName="Ps2989" type="INTEGER" required="false"/>
<column name="ps_6753" phpName="Ps6753" type="INTEGER" required="false"/>
<column name="ps_6759" phpName="Ps6759" type="INTEGER" required="false"/>
<vendor type="mysql"> <vendor type="mysql">
<parameter name="Engine" value="InnoDB"/> <parameter name="Engine" value="InnoDB"/>
</vendor> </vendor>
......
<?php
namespace AppBundle\Model;
use AppBundle\Model\om\BaseSms;
use Monolog\Logger;
use Symfony\Component\DependencyInjection\Container;
use AppBundle\Lib\Utiles;
class Sms extends BaseSms
{
const ELIMINADO_TRUE=TRUE;
const ELIMINADO_FALSE=FALSE;
const ESTADO_PREENVIO=0;
const ESTADO_ENVIADO=1;
const ESTADO_ENVIADO_NOTIF_OK=2;
const ESTADO_ENVIADO_NO_OK=3;
const ESTADO_ENVIADO_NOTIF_NO_OK_BOUNCE=4;
const ESTADO_ENVIADO_NOTIF_NO_OK_COMPLAINT=5;
const TIPO_MASIVO = 1;
const TIPO_UNITARIO = 2;
public static function enviarSms($url, $movil, UsuarioMcafee $usuarioMcafee, Batchsms $batchsms=null, $campana=0, $mensaje, $tipoSms, $transIdCliente=null, Logger $log, Container $container) {
//$FROM_EMAIL = 'no-reply@seguridadtotalmcafee.cl';
//$FROM_EMAIL = 'fcastro@gearlabs.cl';
$envioEmail = null;
<<<<<<< HEAD
=======
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
$tag = '[enviarSms]';
$log->debug($tag."entrando... tipoSms:$tipoSms | campana:$campana | movil:$movil | umcId:".$usuarioMcafee->getUmcId());
try{
$log->debug($tag.'generando sms...');
$sms = new Sms();
if($sms != null)
$sms->setBatchsmsId($batchsms->getBatchsmsId());
$sms->setSmsTipo($tipoSms);
$sms->setUsuarioMcafee($usuarioMcafee);
$sms->setSmsEstado(EnvioEmail::ESTADO_PREENVIO);
if($campana != null)
$sms->setSmsCampana($campana);
$sms->setSmsMovil($movil);
$sms->setSmsFechaEnvio(new \DateTime());
if($transIdCliente !=null)
$sms->setSmsTransIdCliente ($transIdCliente);
$sms->setSmsEliminado(EnvioEmail::ELIMINADO_FALSE);
$sms->save();
<<<<<<< HEAD
$urlDescarga = Sms::acortarUrl($url);
// $urlDescarga = Sms::acortar_url($url);
//$urlDescarga = $url;
$mensaje=$mensaje . $urlDescarga;
$post['to'] = array($movil);
=======
$url = str_replace('#CAMPANA', $campana,$url);
$url = str_replace('#STRUSUARIO', $usuarioMcafee->getUmcParametroEncriptado(),$url);
$url = str_replace('#SMSID', $sms->getSmsId(),$url);
$url = str_replace('#PROCEDENCIA', Tracking::PROCEDENCIA_SMS,$url);
$urlAperturaTrack = str_replace('#ROUTING', 'SMStrack',$url);
$urlAperturaWeb = str_replace('#ROUTING', 'SMStracktemplate',$url);
$urlDescarga = str_replace('#ROUTING', 'descargar',$url);
//$urlDescarga = Sms::acortarUrl($urlDescarga);
$urlDescarga = Sms::acortar_url($urlDescarga);
$mensaje=$mensaje . $urlDescarga;
$post['to'] = array($movil);
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
$post['text'] = $mensaje;
$post['from'] = 'McAfee';
$user ='GearLabs';
$password = 'XCrk02@#';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://sms.teltech.ai/Api/rest/message");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post));
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
"Accept: application/json",
"Authorization: Basic ".base64_encode($user.":".$password)));
curl_setopt($ch, CURLOPT_TIMEOUT, 50);
$result = json_decode(curl_exec($ch), true);
print_r($result);
//print_r($result['error']['code']);
$log->debug($tag.'enviando mensaje...'. $urlDescarga);
<<<<<<< HEAD
/***************************************/
/* $request = '{
=======
/***************************************/
/* $request = '{
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
"api_key":"9df2cfda7cc871680ede6ec24b4a479d",
"report_url":"http://servidoctor.com/callback/script",
"concat":1,
"messages":[
{
"from":"McAfee",
"to":"584165388803",
<<<<<<< HEAD
"text": "Descarga y participa por un SMART TV DE 50 pulgadas: https://cutt.ly/0i41nK",
=======
"text": "Descarga y participa por un SMART TV DE 50 pulgadas: http://bit.ly/2wHyOwK",
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
"send_at":"2018-02-18 17:30:00"
}
]
}';
<<<<<<< HEAD
=======
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
$headers = array('Content-Type: application/json');
$ch = curl_init('https://api.gateway360.com/api/3.0/sms/send');
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);
$result = curl_exec($ch);
print_r('RESULTADO2 '.$result);
if (curl_errno($ch) != 0 ){
die("curl error: ".curl_errno($ch));
} */
/***************************************/
if($result['error']['code']==0){
$log->debug($tag.'SMS enviado OK a '.$movil);
$sms->setSmsFromMensaje($mensaje);
$sms->setSmsEstado(Sms::ESTADO_ENVIADO);
$sms->save();
}
else{
$sms->setSmsEstado(Sms::ESTADO_ENVIADO_NO_OK);
$sms->setSmsFromMensaje($mensaje);
$sms->save();
$logError = Utiles::setLog('AppBundle/Model/sms', 'error/sms');
$logError->err($tag.'error enviar sms... movil'.$movil.' | '.print_r(array(
)));
$log->err($tag.'Se produjo un error al intentar enviar el SMS');
return null;
}
}
catch(\Exception $e){
$log->err($tag."Execption:$e | campana:$campana sms:$movil | umcId:".$usuarioMcafee->getUmcId());
$logError = Utiles::setLog('AppBundle/Model/sms', 'error/sms');
$logError->err($tag."usuarioMcafee no encontrado... campana:$campana | sms:$movil | umcId:".$usuarioMcafee->getUmcId());
return null;
}
return $sms;
}
<<<<<<< HEAD
/* public static function acortar_url($url) {
=======
public static function acortar_url($url) {
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
$usuario = "gearlabs";
$apikey = "R_8bf0031b8f644fec93997b7b23568b76";
$temp = "http://api.bit.ly/v3/shorten?login=".$usuario."&apiKey=".$apikey."&uri=".$url."&format=txt";
return file_get_contents($temp);
<<<<<<< HEAD
}*/
=======
}
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
public static function acortarUrl($data){
$url = "http://url.gearlabs.cl/acortar";
$httpStatus = null;
try {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
$output = curl_exec($ch);
$httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpStatus == 200) {
$arrayRetorno = json_decode($output, true);
return $arrayRetorno['shortLink'];
}
else {
return array('error' => $httpStatus);
}
}
catch (\Exception $e) {
return array(
'error' => 'Error',
'detalle' => $e,
);
}
}
}
...@@ -71,24 +71,4 @@ class BatchsmsTableMap extends TableMap ...@@ -71,24 +71,4 @@ class BatchsmsTableMap extends TableMap
$this->addRelation('Sms', 'AppBundle\\Model\\Sms', RelationMap::ONE_TO_MANY, array('batchsms_id' => 'batchsms_id', ), null, null, 'Smss'); $this->addRelation('Sms', 'AppBundle\\Model\\Sms', RelationMap::ONE_TO_MANY, array('batchsms_id' => 'batchsms_id', ), null, null, 'Smss');
} // buildRelations() } // buildRelations()
<<<<<<< HEAD
=======
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array (
'create_column' => 'created_at',
'update_column' => 'updated_at',
'disable_updated_at' => 'false',
),
);
} // getBehaviors()
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} // BatchsmsTableMap } // BatchsmsTableMap
...@@ -69,24 +69,4 @@ class SmsTableMap extends TableMap ...@@ -69,24 +69,4 @@ class SmsTableMap extends TableMap
$this->addRelation('UsuarioMcafee', 'AppBundle\\Model\\UsuarioMcafee', RelationMap::MANY_TO_ONE, array('umc_id' => 'umc_id', ), null, null); $this->addRelation('UsuarioMcafee', 'AppBundle\\Model\\UsuarioMcafee', RelationMap::MANY_TO_ONE, array('umc_id' => 'umc_id', ), null, null);
} // buildRelations() } // buildRelations()
<<<<<<< HEAD
=======
/**
*
* Gets the list of behaviors registered for this table
*
* @return array Associative array (name => parameters) of behaviors
*/
public function getBehaviors()
{
return array(
'timestampable' => array (
'create_column' => 'created_at',
'update_column' => 'updated_at',
'disable_updated_at' => 'false',
),
);
} // getBehaviors()
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} // SmsTableMap } // SmsTableMap
...@@ -74,10 +74,6 @@ class UsuarioMcafeeTableMap extends TableMap ...@@ -74,10 +74,6 @@ class UsuarioMcafeeTableMap extends TableMap
$this->addRelation('EnvioEmail', 'AppBundle\\Model\\EnvioEmail', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'EnvioEmails'); $this->addRelation('EnvioEmail', 'AppBundle\\Model\\EnvioEmail', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'EnvioEmails');
$this->addRelation('McafeeTransaccion', 'AppBundle\\Model\\McafeeTransaccion', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'McafeeTransaccions'); $this->addRelation('McafeeTransaccion', 'AppBundle\\Model\\McafeeTransaccion', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'McafeeTransaccions');
$this->addRelation('McafeeTransaccionPendiente', 'AppBundle\\Model\\McafeeTransaccionPendiente', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'McafeeTransaccionPendientes'); $this->addRelation('McafeeTransaccionPendiente', 'AppBundle\\Model\\McafeeTransaccionPendiente', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'McafeeTransaccionPendientes');
<<<<<<< HEAD
=======
$this->addRelation('McafeeUltimoProcesoNormalizacion', 'AppBundle\\Model\\McafeeUltimoProcesoNormalizacion', RelationMap::ONE_TO_MANY, array('umc_id' => 'ultimo_umc_id', ), null, null, 'McafeeUltimoProcesoNormalizacions');
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
$this->addRelation('Sms', 'AppBundle\\Model\\Sms', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'Smss'); $this->addRelation('Sms', 'AppBundle\\Model\\Sms', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'Smss');
$this->addRelation('Tracking', 'AppBundle\\Model\\Tracking', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'Trackings'); $this->addRelation('Tracking', 'AppBundle\\Model\\Tracking', RelationMap::ONE_TO_MANY, array('umc_id' => 'umc_id', ), null, null, 'Trackings');
} // buildRelations() } // buildRelations()
......
...@@ -1023,24 +1023,8 @@ abstract class BaseBatchsms extends BaseObject implements Persistent ...@@ -1023,24 +1023,8 @@ abstract class BaseBatchsms extends BaseObject implements Persistent
$ret = $this->preSave($con); $ret = $this->preSave($con);
if ($isInsert) { if ($isInsert) {
$ret = $ret && $this->preInsert($con); $ret = $ret && $this->preInsert($con);
<<<<<<< HEAD
} else { } else {
$ret = $ret && $this->preUpdate($con); $ret = $ret && $this->preUpdate($con);
=======
// timestampable behavior
if (!$this->isColumnModified(BatchsmsPeer::CREATED_AT)) {
$this->setCreatedAt(time());
}
if (!$this->isColumnModified(BatchsmsPeer::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
if ($this->isModified() && !$this->isColumnModified(BatchsmsPeer::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} }
if ($ret) { if ($ret) {
$affectedRows = $this->doSave($con); $affectedRows = $this->doSave($con);
...@@ -2156,21 +2140,4 @@ abstract class BaseBatchsms extends BaseObject implements Persistent ...@@ -2156,21 +2140,4 @@ abstract class BaseBatchsms extends BaseObject implements Persistent
return $this->alreadyInSave; return $this->alreadyInSave;
} }
<<<<<<< HEAD
=======
// timestampable behavior
/**
* Mark the current object so that the update date doesn't get updated during next save
*
* @return Batchsms The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
$this->modifiedColumns[] = BatchsmsPeer::UPDATED_AT;
return $this;
}
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} }
...@@ -1130,72 +1130,4 @@ abstract class BaseBatchsmsQuery extends ModelCriteria ...@@ -1130,72 +1130,4 @@ abstract class BaseBatchsmsQuery extends ModelCriteria
return $this; return $this;
} }
<<<<<<< HEAD
=======
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return BatchsmsQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(BatchsmsPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return BatchsmsQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(BatchsmsPeer::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return BatchsmsQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(BatchsmsPeer::UPDATED_AT);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return BatchsmsQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(BatchsmsPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by create date desc
*
* @return BatchsmsQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(BatchsmsPeer::CREATED_AT);
}
/**
* Order by create date asc
*
* @return BatchsmsQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(BatchsmsPeer::CREATED_AT);
}
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} }
...@@ -980,24 +980,8 @@ abstract class BaseSms extends BaseObject implements Persistent ...@@ -980,24 +980,8 @@ abstract class BaseSms extends BaseObject implements Persistent
$ret = $this->preSave($con); $ret = $this->preSave($con);
if ($isInsert) { if ($isInsert) {
$ret = $ret && $this->preInsert($con); $ret = $ret && $this->preInsert($con);
<<<<<<< HEAD
} else { } else {
$ret = $ret && $this->preUpdate($con); $ret = $ret && $this->preUpdate($con);
=======
// timestampable behavior
if (!$this->isColumnModified(SmsPeer::CREATED_AT)) {
$this->setCreatedAt(time());
}
if (!$this->isColumnModified(SmsPeer::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
} else {
$ret = $ret && $this->preUpdate($con);
// timestampable behavior
if ($this->isModified() && !$this->isColumnModified(SmsPeer::UPDATED_AT)) {
$this->setUpdatedAt(time());
}
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} }
if ($ret) { if ($ret) {
$affectedRows = $this->doSave($con); $affectedRows = $this->doSave($con);
...@@ -1907,21 +1891,4 @@ abstract class BaseSms extends BaseObject implements Persistent ...@@ -1907,21 +1891,4 @@ abstract class BaseSms extends BaseObject implements Persistent
return $this->alreadyInSave; return $this->alreadyInSave;
} }
<<<<<<< HEAD
=======
// timestampable behavior
/**
* Mark the current object so that the update date doesn't get updated during next save
*
* @return Sms The current object (for fluent API support)
*/
public function keepUpdateDateUnchanged()
{
$this->modifiedColumns[] = SmsPeer::UPDATED_AT;
return $this;
}
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} }
...@@ -1016,72 +1016,4 @@ abstract class BaseSmsQuery extends ModelCriteria ...@@ -1016,72 +1016,4 @@ abstract class BaseSmsQuery extends ModelCriteria
return $this; return $this;
} }
<<<<<<< HEAD
=======
// timestampable behavior
/**
* Filter by the latest updated
*
* @param int $nbDays Maximum age of the latest update in days
*
* @return SmsQuery The current query, for fluid interface
*/
public function recentlyUpdated($nbDays = 7)
{
return $this->addUsingAlias(SmsPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by update date desc
*
* @return SmsQuery The current query, for fluid interface
*/
public function lastUpdatedFirst()
{
return $this->addDescendingOrderByColumn(SmsPeer::UPDATED_AT);
}
/**
* Order by update date asc
*
* @return SmsQuery The current query, for fluid interface
*/
public function firstUpdatedFirst()
{
return $this->addAscendingOrderByColumn(SmsPeer::UPDATED_AT);
}
/**
* Filter by the latest created
*
* @param int $nbDays Maximum age of in days
*
* @return SmsQuery The current query, for fluid interface
*/
public function recentlyCreated($nbDays = 7)
{
return $this->addUsingAlias(SmsPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
}
/**
* Order by create date desc
*
* @return SmsQuery The current query, for fluid interface
*/
public function lastCreatedFirst()
{
return $this->addDescendingOrderByColumn(SmsPeer::CREATED_AT);
}
/**
* Order by create date asc
*
* @return SmsQuery The current query, for fluid interface
*/
public function firstCreatedFirst()
{
return $this->addAscendingOrderByColumn(SmsPeer::CREATED_AT);
}
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
} }
...@@ -15,10 +15,6 @@ use \PropelPDO; ...@@ -15,10 +15,6 @@ use \PropelPDO;
use AppBundle\Model\EnvioEmail; use AppBundle\Model\EnvioEmail;
use AppBundle\Model\McafeeTransaccion; use AppBundle\Model\McafeeTransaccion;
use AppBundle\Model\McafeeTransaccionPendiente; use AppBundle\Model\McafeeTransaccionPendiente;
<<<<<<< HEAD
=======
use AppBundle\Model\McafeeUltimoProcesoNormalizacion;
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
use AppBundle\Model\Sms; use AppBundle\Model\Sms;
use AppBundle\Model\Tracking; use AppBundle\Model\Tracking;
use AppBundle\Model\UsuarioMcafee; use AppBundle\Model\UsuarioMcafee;
...@@ -90,10 +86,6 @@ use AppBundle\Model\UsuarioMcafeeQuery; ...@@ -90,10 +86,6 @@ use AppBundle\Model\UsuarioMcafeeQuery;
* @method UsuarioMcafeeQuery rightJoinSms($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Sms relation * @method UsuarioMcafeeQuery rightJoinSms($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Sms relation
* @method UsuarioMcafeeQuery innerJoinSms($relationAlias = null) Adds a INNER JOIN clause to the query using the Sms relation * @method UsuarioMcafeeQuery innerJoinSms($relationAlias = null) Adds a INNER JOIN clause to the query using the Sms relation
* *
* @method UsuarioMcafeeQuery leftJoinSms($relationAlias = null) Adds a LEFT JOIN clause to the query using the Sms relation
* @method UsuarioMcafeeQuery rightJoinSms($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Sms relation
* @method UsuarioMcafeeQuery innerJoinSms($relationAlias = null) Adds a INNER JOIN clause to the query using the Sms relation
*
* @method UsuarioMcafeeQuery leftJoinTracking($relationAlias = null) Adds a LEFT JOIN clause to the query using the Tracking relation * @method UsuarioMcafeeQuery leftJoinTracking($relationAlias = null) Adds a LEFT JOIN clause to the query using the Tracking relation
* @method UsuarioMcafeeQuery rightJoinTracking($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Tracking relation * @method UsuarioMcafeeQuery rightJoinTracking($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Tracking relation
* @method UsuarioMcafeeQuery innerJoinTracking($relationAlias = null) Adds a INNER JOIN clause to the query using the Tracking relation * @method UsuarioMcafeeQuery innerJoinTracking($relationAlias = null) Adds a INNER JOIN clause to the query using the Tracking relation
...@@ -248,11 +240,7 @@ abstract class BaseUsuarioMcafeeQuery extends ModelCriteria ...@@ -248,11 +240,7 @@ abstract class BaseUsuarioMcafeeQuery extends ModelCriteria
*/ */
protected function findPkSimple($key, $con) protected function findPkSimple($key, $con)
{ {
<<<<<<< HEAD
$sql = 'SELECT `umc_id`, `umc_mcafee_tipo_producto`, `umc_mcafee_affid`, `umc_mcafee_ccid`, `umc_mcafee_email`, `umc_mcafee_sku`, `umc_mcafee_keycard`, `umc_mcafee_status`, `umc_movistar_activo`, `umc_movistar_any`, `umc_movistar_email`, `umc_movistar_rut`, `umc_parametro_encriptado`, `umc_permite_email`, `umc_fecha_desuscripcion_email`, `umc_movil`, `umc_customer_id`, `umc_eliminado`, `umc_permite_sms`, `created_at`, `updated_at` FROM `usuario_mcafee` WHERE `umc_id` = :p0'; $sql = 'SELECT `umc_id`, `umc_mcafee_tipo_producto`, `umc_mcafee_affid`, `umc_mcafee_ccid`, `umc_mcafee_email`, `umc_mcafee_sku`, `umc_mcafee_keycard`, `umc_mcafee_status`, `umc_movistar_activo`, `umc_movistar_any`, `umc_movistar_email`, `umc_movistar_rut`, `umc_parametro_encriptado`, `umc_permite_email`, `umc_fecha_desuscripcion_email`, `umc_movil`, `umc_customer_id`, `umc_eliminado`, `umc_permite_sms`, `created_at`, `updated_at` FROM `usuario_mcafee` WHERE `umc_id` = :p0';
=======
$sql = 'SELECT `umc_id`, `umc_mcafee_tipo_producto`, `umc_mcafee_affid`, `umc_mcafee_ccid`, `umc_mcafee_email`, `umc_mcafee_sku`, `umc_mcafee_keycard`, `umc_mcafee_status`, `umc_movistar_activo`, `umc_movistar_any`, `umc_movistar_email`, `umc_movistar_rut`, `umc_parametro_encriptado`, `umc_permite_email`, `umc_fecha_desuscripcion_email`, `umc_movil`, `umc_fijo`, `umc_customer_id`, `umc_eliminado`, `umc_permite_sms`, `created_at`, `updated_at` FROM `usuario_mcafee` WHERE `umc_id` = :p0';
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
try { try {
$stmt = $con->prepare($sql); $stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT); $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
...@@ -1319,80 +1307,6 @@ abstract class BaseUsuarioMcafeeQuery extends ModelCriteria ...@@ -1319,80 +1307,6 @@ abstract class BaseUsuarioMcafeeQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'Sms', '\AppBundle\Model\SmsQuery'); ->useQuery($relationAlias ? $relationAlias : 'Sms', '\AppBundle\Model\SmsQuery');
} }
/**
* Filter the query by a related Sms object
*
* @param Sms|PropelObjectCollection $sms the related object to use as filter
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return UsuarioMcafeeQuery The current query, for fluid interface
* @throws PropelException - if the provided filter is invalid.
*/
public function filterBySms($sms, $comparison = null)
{
if ($sms instanceof Sms) {
return $this
->addUsingAlias(UsuarioMcafeePeer::UMC_ID, $sms->getUmcId(), $comparison);
} elseif ($sms instanceof PropelObjectCollection) {
return $this
->useSmsQuery()
->filterByPrimaryKeys($sms->getPrimaryKeys())
->endUse();
} else {
throw new PropelException('filterBySms() only accepts arguments of type Sms or PropelCollection');
}
}
/**
* Adds a JOIN clause to the query using the Sms relation
*
* @param string $relationAlias optional alias for the relation
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return UsuarioMcafeeQuery The current query, for fluid interface
*/
public function joinSms($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
$tableMap = $this->getTableMap();
$relationMap = $tableMap->getRelation('Sms');
// create a ModelJoin object for this join
$join = new ModelJoin();
$join->setJoinType($joinType);
$join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
if ($previousJoin = $this->getPreviousJoin()) {
$join->setPreviousJoin($previousJoin);
}
// add the ModelJoin to the current object
if ($relationAlias) {
$this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
$this->addJoinObject($join, $relationAlias);
} else {
$this->addJoinObject($join, 'Sms');
}
return $this;
}
/**
* Use the Sms relation Sms object
*
* @see useQuery()
*
* @param string $relationAlias optional alias for the relation,
* to be used as main alias in the secondary query
* @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
*
* @return \AppBundle\Model\SmsQuery A secondary query class using the current class as primary query
*/
public function useSmsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
{
return $this
->joinSms($relationAlias, $joinType)
->useQuery($relationAlias ? $relationAlias : 'Sms', '\AppBundle\Model\SmsQuery');
}
/** /**
* Filter the query by a related Tracking object * Filter the query by a related Tracking object
* *
......
...@@ -36,29 +36,15 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand ...@@ -36,29 +36,15 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand
$log->debug('************************Iniciando McafeeEnviarSmsCommand ************************'); $log->debug('************************Iniciando McafeeEnviarSmsCommand ************************');
$tt = new TiempoTranscurrido(); $tt = new TiempoTranscurrido();
<<<<<<< HEAD //$fp = fopen("/opt/sdp/intelsecuritymovistar/etc/sms/3_36460.csv", "r");
//$fp = fopen("C:\ana3\movistarChile\prueba.csv", "r");
$fp = fopen("/opt/sdp/intelsecuritymovistar/etc/sms/3_36460.csv", "r");
=======
$fp = fopen("C:\ana3\movistarChile\prueba.csv", "r"); $fp = fopen("C:\ana3\movistarChile\prueba.csv", "r");
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
if (!$fp) { if (!$fp) {
$log->warning('Error al intentar abrir el archivo'); $log->warning('Error al intentar abrir el archivo');
$output->writeln('Error al intentar abrir el archivo.'); $output->writeln('Error al intentar abrir el archivo.');
return; return;
} }
$urlBase = 'https://www.seguridadtotalmcafee.cl';
<<<<<<< HEAD
//$urlDescarga = $urlBase.'/#ROUTING/#CAMPANA/#STRUSUARIO/#PROCEDENCIA/#SMSID';
=======
$urlDescarga = $urlBase.'/#ROUTING/#CAMPANA/#STRUSUARIO/#PROCEDENCIA/#SMSID';
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
$tDesOK = 0; $tDesOK = 0;
$tDesNOOK = 0; $tDesNOOK = 0;
...@@ -73,7 +59,9 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand ...@@ -73,7 +59,9 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand
$count = 1; $count = 1;
$TOTAL = 0; $TOTAL = 0;
$batchsms = new Batchsms(); $batchsms = new Batchsms();
$batchsms->setBatchsmsEliminado(Batchsms::ELIMINADO_FALSE); $batchsms->setBatchsmsEliminado(Batchsms::ELIMINADO_FALSE);
$batchsms->save(); $batchsms->save();
...@@ -133,16 +121,10 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand ...@@ -133,16 +121,10 @@ class McafeeEnviarSmsCommand extends ContainerAwareCommand
$mensaje="Descarga y participa por un SMART TV DE 50: "; $mensaje="Descarga y participa por un SMART TV DE 50: ";
<<<<<<< HEAD
$urlDescarga = $usuarioMcafee->getUmcMcafeeKeycard(); $urlDescarga = $usuarioMcafee->getUmcMcafeeKeycard();
=======
>>>>>>> 1631fbd75af5098b86e14ff858d86fbf3506daf8
$sms = Sms::enviarSms($urlDescarga, $movil, $usuarioMcafee, $batchsms, $campana, $mensaje, Sms::TIPO_MASIVO,null,$log, $this->getContainer()); $sms = Sms::enviarSms($urlDescarga, $movil, $usuarioMcafee, $batchsms, $campana, $mensaje, Sms::TIPO_MASIVO,null,$log, $this->getContainer());
if($sms){ if($sms){
$tEnviadoOK++; $tEnviadoOK++;
$cont = $cont+1; $cont = $cont+1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment