historial_id
This commit is contained in:
@@ -160,6 +160,7 @@ class MenuController extends Controller
|
||||
$logsGeneral->user_id = $consulta_recarga->usuario_id;
|
||||
$logsGeneral->detalle = 'El usuario '.$nombre.' - '.$email.'ha recargador por MP el monto de ' . $monto . ', Nuevo saldo disponible: $'.$nuevo_saldo;
|
||||
$logsGeneral->tipo = 'recarga';
|
||||
$logsGeneral->historial_id = null;
|
||||
$logsGeneral->save();
|
||||
|
||||
}
|
||||
|
||||
@@ -78,7 +78,8 @@ class Bell extends Component
|
||||
Log_general::create([
|
||||
'user_id' => Auth::user()->id,
|
||||
'detalle' => 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha reclamado el premio de $' . $notificacion->premio,
|
||||
'tipo' => 'premio'
|
||||
'tipo' => 'premio',
|
||||
'historial_id' => null
|
||||
]);
|
||||
|
||||
$this->reclamandoPremio = false;
|
||||
|
||||
@@ -348,6 +348,7 @@ class ShowPlanes extends Component
|
||||
$logsGeneral->user_id = $historial_cuenta->historial->vendedor_id;
|
||||
$logsGeneral->detalle = 'Se asigno una cuenta ' . $servicioName . ', con credenciales: ' . $historial_cuenta->cuenta->correo . ' contraseña: ' . $historial_cuenta->cuenta->password . ' Que se encontraba en estado pendiente';
|
||||
$logsGeneral->tipo = 'asigno_cuenta';
|
||||
$logsGeneral->historial_id= $historial_cuenta->historial_id;
|
||||
$logsGeneral->save();
|
||||
}
|
||||
}
|
||||
@@ -419,6 +420,7 @@ class ShowPlanes extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha renovado el servicio:' . $servicioNombre . ' con cuenta ' . $cuenta->correo . ' para el cliente: ' . $historial->cliente->name . ' - ' . $historial->cliente->email;
|
||||
$logsGeneral->tipo = 'renovo_cuenta';
|
||||
$logsGeneral->historial_id = $historial_guardar->id;
|
||||
$logsGeneral->save();
|
||||
}
|
||||
}
|
||||
@@ -496,6 +498,7 @@ class ShowPlanes extends Component
|
||||
$logsGeneral->user_id = $historial_cuenta->historial->vendedor_id;
|
||||
$logsGeneral->detalle = 'Se asigno una cuenta ' . $servicioName . ', con credenciales: ' . $historial_cuenta->cuenta->correo . ' contraseña: ' . $historial_cuenta->cuenta->password . ' Que se encontraba en estado pendiente';
|
||||
$logsGeneral->tipo = 'asigno_cuenta';
|
||||
$logsGeneral->historial_id = $historial_cuenta->historial_id;
|
||||
$logsGeneral->save();
|
||||
}
|
||||
|
||||
@@ -819,6 +822,8 @@ class ShowPlanes extends Component
|
||||
$logsGeneral = new Log_general();
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha añadido el usuario ' . $this->searchTerm . ' a una cuenta ';
|
||||
$logsGeneral->tipo = 'asignar_cuenta';
|
||||
$logsGeneral->historial_id = $historial->id;
|
||||
// . ' a la cuenta ' . $this->consulta_verUsuarios->name . ' - ' . $this->consulta_verUsuarios->email;
|
||||
$logsGeneral->save();
|
||||
|
||||
|
||||
@@ -365,6 +365,7 @@ class ShowPromociones extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado la promocion ' . $this->consulta->nombre . ' - ' . $this->consulta->descripcion . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor .', Saldo anterior: $'.$saldo_anterior.', Nuevo saldo disponible: $'.$nuevo_saldo;
|
||||
$logsGeneral->tipo = 'compra';
|
||||
$logsGeneral->historial_id = $historial->id;
|
||||
$logsGeneral->save();
|
||||
|
||||
$this->modalComprarPromo = false;
|
||||
@@ -406,6 +407,7 @@ class ShowPromociones extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado la promocion ' . $this->consulta->nombre . ' - ' . $this->consulta->descripcion . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor ?? '' . ' y algunos han quedado pendientes'.', Saldo anterior: $'.$saldo_anterior.', Nuevo saldo disponible: $'.$nuevo_saldo;
|
||||
$logsGeneral->tipo = 'compra';
|
||||
$logsGeneral->historial_id = $this->historial->id;
|
||||
$logsGeneral->save();
|
||||
|
||||
$this->credenciales($this->historial);
|
||||
@@ -415,6 +417,7 @@ class ShowPromociones extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error en el cobro, Comprando la promoción ' . $this->consulta->nombre . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor .' No se desconto el saldo, ni se asignaron cuentas.';
|
||||
$logsGeneral->tipo = 'compra_error';
|
||||
$logsGeneral->historial_id = $this->historial->id;
|
||||
$logsGeneral->save();
|
||||
$this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [
|
||||
'position' => 'top'
|
||||
@@ -438,6 +441,7 @@ class ShowPromociones extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Cancelo la compra del plan ' . $this->consulta->nombre . ' cantidad de ' . $this->historial->cantidad . ' por un valor de $' . $this->historial->valor.' No se desconto el saldo, ni se asignaron cuentas.';
|
||||
$logsGeneral->tipo = 'compra_cancelada';
|
||||
$logsGeneral->historial_id = $this->historial->id;
|
||||
$logsGeneral->save();
|
||||
$this->alert('success', 'Compra cancelada!', [
|
||||
'position' => 'top'
|
||||
|
||||
@@ -406,6 +406,7 @@ class ShowServicios extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error de "No hay cuentas disponibles" Comprando el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor . ' Se desligaron todas las cuentas.';
|
||||
$logsGeneral->tipo = 'compra_error';
|
||||
$logsGeneral->historial_id= $historial->id;
|
||||
$logsGeneral->save();
|
||||
$this->alert('warning', 'No hay cuentas disponibles!', [
|
||||
'position' => 'top'
|
||||
@@ -426,6 +427,7 @@ class ShowServicios extends Component
|
||||
$logsGeneral = new Log_general();
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha comprado el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor . ', Saldo anterior: $' . $saldo_anterior . ', Nuevo saldo disponible: $' . $nuevo_saldo;
|
||||
$logsGeneral->historial_id= $historial->id;
|
||||
$logsGeneral->tipo = 'compra';
|
||||
$logsGeneral->save();
|
||||
|
||||
@@ -438,6 +440,7 @@ class ShowServicios extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo un error con el cobro del servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor;
|
||||
$logsGeneral->tipo = 'compra_error';
|
||||
$logsGeneral->historial_id= $historial->id;
|
||||
$logsGeneral->save();
|
||||
$eliminar = Historial_cuenta::where('historial_id', $historial->id)->delete();
|
||||
$this->alert('warning', 'Error en el cobro, comuniquese con soporte!', [
|
||||
@@ -452,6 +455,7 @@ class ShowServicios extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' Tuvo error de "No hay cuentas disponibles" Comprando el servicio ' . $servicioNombre . ' - ' . $cuentasMostar . ' cantidad de ' . $this->cantidad_tarjetaPlan . ' por un valor de $' . $total_valor . ' No se desconto el saldo, ni se asignaron cuentas.';
|
||||
$logsGeneral->tipo = 'compra_error';
|
||||
$logsGeneral->historial_id= $historial->id;
|
||||
$logsGeneral->save();
|
||||
$this->alert('warning', 'No hay cuentas disponibles!', [
|
||||
'position' => 'top'
|
||||
|
||||
@@ -93,7 +93,8 @@ class ShowTop extends Component
|
||||
Log_general::create([
|
||||
'user_id' => Auth::user()->id,
|
||||
'detalle' => 'El usuario ' . Auth::user()->name . ' ha entregado el premio ' . $premio . ' para el usuario: ' . $vendedor->name . ' - ' . $vendedor->email,
|
||||
'tipo' => 'premio'
|
||||
'tipo' => 'premio',
|
||||
'historial_id' => null
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
@@ -267,6 +267,7 @@ class ShowUsuarios extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha recargado a ' . $nombre . ' - ' . $email . ' la cantidad de $' . $this->valor_recargar . ', Saldo anterior: $' . $this->saldo_actual . ', Nuevo saldo disponible: $' . $nuevo_saldo;
|
||||
$logsGeneral->tipo = 'recarga';
|
||||
$logsGeneral->historial_id = null;
|
||||
$logsGeneral->save();
|
||||
|
||||
$this->alert('success', 'Saldo actualizado con exito!', [
|
||||
@@ -302,6 +303,7 @@ class ShowUsuarios extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha descontado la cantidad de $' . $this->valor_recargar . ' al usuario ' . $userSaldo->name . ' - ' . $userSaldo->email;
|
||||
$logsGeneral->tipo = 'descuento_saldo';
|
||||
$logsGeneral->historial_id = null;
|
||||
$logsGeneral->save();
|
||||
|
||||
|
||||
@@ -572,6 +574,7 @@ class ShowUsuarios extends Component
|
||||
$logsGeneral->user_id = Auth::user()->id;
|
||||
$logsGeneral->detalle = 'El usuario ' . Auth::user()->name . ' - ' . Auth::user()->email . ' ha eliminado al usuario ' . $user->name . ' - ' . $user->email;
|
||||
$logsGeneral->tipo = 'eliminar_usuario';
|
||||
$logsGeneral->historial_id = null;
|
||||
$logsGeneral->save();
|
||||
|
||||
$user->delete();
|
||||
|
||||
@@ -67,6 +67,7 @@ class UsersImport implements ToModel
|
||||
$logsGeneral->user_id = $historial_cuenta->historial->vendedor_id;
|
||||
$logsGeneral->detalle = 'Se asigno una cuenta '. $servicioName .', con credenciales: '. $historial_cuenta->cuenta->correo . ' contraseña: ' . $historial_cuenta->cuenta->password.' Que se encontraba en estado pendiente';
|
||||
$logsGeneral->tipo = 'asigno_cuenta';
|
||||
$logsGeneral->historial_id = $cuentaPendiente->historial_id;
|
||||
$logsGeneral->save();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('log_general', function (Blueprint $table) {
|
||||
$table->string('historial_id')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('log_general', function (Blueprint $table) {
|
||||
$table->dropColumn('historial_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user