This commit is contained in:
lizandrogd
2023-11-07 12:30:39 -05:00
3 changed files with 75 additions and 77 deletions
+13 -15
View File
@@ -28,12 +28,12 @@ class Kernel extends ConsoleKernel
* @return void * @return void
*/ */
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)
{ {
// $schedule->exec('nohup php /home/u111286300/domains/sirpremium.com.co/public_html/app/artisan queue:work --sleep=3 --tries=3 > /dev/null 2>&1 &')->everyMinute();
// $schedule->exec('nohup php /var/www/sirpremium/artisan queue:work --sleep=3 --tries=3 > /dev/null 2>&1 &')->everyMinute();
//$schedule->exec('nohup php /var/www/sirpremium/artisan queue:work --sleep=3 --tries=3 > /dev/null 2>&1 &')->everyMinute();
$schedule->call(function () { $schedule->call(function () {
$fechaHoy = Carbon::now(); $fechaHoy = Carbon::now();
@@ -48,7 +48,7 @@ class Kernel extends ConsoleKernel
if (!empty($item->promocion_id)) { if (!empty($item->promocion_id)) {
$nombre= $item->promocion->nombre; $nombre = $item->promocion->nombre;
} }
if (!empty($item->tarifa_id)) { if (!empty($item->tarifa_id)) {
$nombre = $item->tarifa->servicio->nombre . '-' . $item->tarifa->pantallas . 'P'; $nombre = $item->tarifa->servicio->nombre . '-' . $item->tarifa->pantallas . 'P';
@@ -60,7 +60,7 @@ class Kernel extends ConsoleKernel
'cliente' => $item->cliente->name, 'cliente' => $item->cliente->name,
'servicio' => $nombre, 'servicio' => $nombre,
'tipo' => 'vencimiento', 'tipo' => 'vencimiento',
'vendedor' =>$item->vendedor->name, 'vendedor' => $item->vendedor->name,
]; ];
@@ -93,7 +93,7 @@ class Kernel extends ConsoleKernel
// $response = curl_exec($curl); // $response = curl_exec($curl);
// $err = curl_error($curl); // $err = curl_error($curl);
// //
//curl_close($curl); //curl_close($curl);
//return $response; //return $response;
// if ($err) { // if ($err) {
@@ -109,24 +109,22 @@ class Kernel extends ConsoleKernel
$fechaHoy1 = Carbon::now(); $fechaHoy1 = Carbon::now();
$fechaHoy1 = Carbon::parse($fechaHoy1)->subDay(1); $fechaHoy1 = Carbon::parse($fechaHoy1)->subDay(1);
$consulta_historial1= Historiale::whereDate('fecha_final','<',$fechaHoy1)->with('cliente','cuentas')->get(); $consulta_historial1 = Historiale::whereDate('fecha_final', '<', $fechaHoy1)->with('cliente', 'cuentas')->get();
foreach ($consulta_historial1 as $item1) { foreach ($consulta_historial1 as $item1) {
foreach($item1->cuentas->unique() as $item2){ foreach ($item1->cuentas->unique() as $item2) {
//dd($item2);
$logs = new log; $logs = new log;
$logs->historial_id = $item1->id; $logs->historial_id = $item1->id;
$logs->cuenta_id = $item2->id; $logs->cuenta_id = $item2->id;
$logs->save(); $logs->save();
}
//$eliminar_cuentas = Historial_cuenta::where('historial_id',$item1->id)->truncate();
//dd('termine');
Historial_cuenta::where('historial_id', $item1->id)->where('cuenta_id', $item2->id)->delete();
}
} }
})->dailyAt(Configuracione::orderby('id','desc')->first()->hora);
})->dailyAt(Configuracione::orderby('id', 'desc')->first()->hora);
} }
@@ -138,7 +136,7 @@ class Kernel extends ConsoleKernel
*/ */
protected function commands() protected function commands()
{ {
$this->load(__DIR__.'/Commands'); $this->load(__DIR__ . '/Commands');
require base_path('routes/console.php'); require base_path('routes/console.php');
} }
@@ -8,7 +8,7 @@
<td class="pl-[2rem] text-xs sm:text-sm ">{{ $cuenta->correo ?? '' }}</td> <td class="pl-[2rem] text-xs sm:text-sm ">{{ $cuenta->correo ?? '' }}</td>
<td class="pl-[2rem] text-xs sm:text-sm ">{{ $cuenta->password ?? '' }}</td> <td class="pl-[2rem] text-xs sm:text-sm ">{{ $cuenta->password ?? '' }}</td>
<td class="pl-[2rem] text-xs hidden md:inline-table"> <td class="pl-[2rem] text-xs hidden md:table-cell">
{{ carbon\Carbon::parse($cuenta->inicio)->format('d M Y') ?? '' }} - {{ carbon\Carbon::parse($cuenta->inicio)->format('d M Y') ?? '' }} -
{{ carbon\Carbon::parse($cuenta->vencimiento)->format('d M Y') ?? '' }}</td> {{ carbon\Carbon::parse($cuenta->vencimiento)->format('d M Y') ?? '' }}</td>
@@ -72,7 +72,7 @@
Inactiva Inactiva
@endif @endif
</td> </td>
<td class="m-auto hidden md:inline-table"> <td class="m-auto hidden md:table-cell">
<button x-on:click="ver=true" wire:click="ver({{ $cuenta->id }},'{{ $servicioNom }}')" <button x-on:click="ver=true" wire:click="ver({{ $cuenta->id }},'{{ $servicioNom }}')"
class="bg-[#B221FD] hover:bg-[#7a02b8] text-white px-4 py-1 rounded-lg">Ver</button> class="bg-[#B221FD] hover:bg-[#7a02b8] text-white px-4 py-1 rounded-lg">Ver</button>
</td> </td>
@@ -108,7 +108,7 @@
@endif @endif
</div> </div>
</td> </td>
<td class="pl-2 md:inline-table"> <td class="pl-2 md:table-cell">
@if (!empty($cuenta->observaciones)) @if (!empty($cuenta->observaciones))
<div class="cursor-pointer" x-on:click="openOption=false,observacionesm1=true" <div class="cursor-pointer" x-on:click="openOption=false,observacionesm1=true"
title="{{ $cuenta->observaciones }}" wire:click="verObservacion1({{ $cuenta->id }})"> title="{{ $cuenta->observaciones }}" wire:click="verObservacion1({{ $cuenta->id }})">
@@ -142,13 +142,13 @@
<th class="font-normal pl-[2rem]">Servicio</th> <th class="font-normal pl-[2rem]">Servicio</th>
<th class="font-normal pl-[2rem]">Correo</th> <th class="font-normal pl-[2rem]">Correo</th>
<th class="font-normal pl-[2rem]">Contraseña</th> <th class="font-normal pl-[2rem]">Contraseña</th>
<th class="font-normal pl-[2rem] hidden md:inline-table">Inicio - Final</th> <th class="font-normal pl-[2rem] hidden md:table-cell">Inicio - Final</th>
<th class="font-normal pl-[2rem]">Restante</th> <th class="font-normal pl-[2rem]">Restante</th>
<th class="font-normal pl-[2rem]">Ocupado</th> <th class="font-normal pl-[2rem]">Ocupado</th>
<th class="font-normal pl-[2rem]"></th> <th class="font-normal pl-[2rem]"></th>
<th class="font-normal pl-[2rem] hidden md:inline-table"></th> <th class="font-normal pl-[2rem] hidden md:table-cell"></th>
<th class="font-normal rounded-r-lg md:rounded-r-none"></th> <th class="font-normal rounded-r-lg md:rounded-r-none"></th>
<th class="rounded-r-lg font-normal hidden md:inline-table"></th> <th class="rounded-r-lg font-normal hidden md:table-cell"></th>
</tr> </tr>
</x-slot> </x-slot>
<x-slot name="tbody"> <x-slot name="tbody">