Update validacionCompra.php
This commit is contained in:
@@ -60,6 +60,8 @@ class validacionCompra extends Command
|
|||||||
foreach ($registro_vendedores_duplicados as $index => $registro) {
|
foreach ($registro_vendedores_duplicados as $index => $registro) {
|
||||||
if ($index > 0) {
|
if ($index > 0) {
|
||||||
$anterior = $registro_vendedores_duplicados[$index - 1];
|
$anterior = $registro_vendedores_duplicados[$index - 1];
|
||||||
|
if ($anterior->valor == $registro->valor && $anterior->tarifa_id == $registro->tarifa_id && $anterior->promocion_id == $registro->promocion_id) {
|
||||||
|
|
||||||
$diferencia = Carbon::parse($anterior->created_at)->diffInSeconds(Carbon::parse($registro->created_at));
|
$diferencia = Carbon::parse($anterior->created_at)->diffInSeconds(Carbon::parse($registro->created_at));
|
||||||
|
|
||||||
if ($diferencia < 20) {
|
if ($diferencia < 20) {
|
||||||
@@ -100,7 +102,7 @@ class validacionCompra extends Command
|
|||||||
'tipo' => 'corregido',
|
'tipo' => 'corregido',
|
||||||
'detalle' => 'Se ha corregido la compra duplicada, usuario: ' . $email . ' - ' .
|
'detalle' => 'Se ha corregido la compra duplicada, usuario: ' . $email . ' - ' .
|
||||||
Carbon::parse($registro->created_at)->format('d M Y h:i A') . ' - ' .
|
Carbon::parse($registro->created_at)->format('d M Y h:i A') . ' - ' .
|
||||||
Carbon::parse($anterior->created_at)->format('d M Y h:i A').' - Saldo retornado:'.$registro->valor,
|
Carbon::parse($anterior->created_at)->format('d M Y h:i A') . ' - Saldo retornado:' . $registro->valor,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +113,7 @@ class validacionCompra extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function enviarTelegram($mensaje)
|
public function enviarTelegram($mensaje)
|
||||||
{
|
{
|
||||||
@@ -181,7 +184,7 @@ class validacionCompra extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function validarSaldosNegativos($anterior,$actual)
|
public function validarSaldosNegativos($anterior, $actual)
|
||||||
{
|
{
|
||||||
$consultaLog = Log_general::whereBetween('created_at', [$anterior, $actual])
|
$consultaLog = Log_general::whereBetween('created_at', [$anterior, $actual])
|
||||||
->where('detalle', 'LIKE', '%disponible: $-%')
|
->where('detalle', 'LIKE', '%disponible: $-%')
|
||||||
|
|||||||
Reference in New Issue
Block a user