v0.11.1d - Fixed WashingReservation
This commit is contained in:
parent
2f5a03343a
commit
821428c150
|
@ -132,6 +132,7 @@ class WashingReservationController extends Controller
|
||||||
public function destroy($id)
|
public function destroy($id)
|
||||||
{
|
{
|
||||||
$machineReservation = WashingReservation::find($id);
|
$machineReservation = WashingReservation::find($id);
|
||||||
|
dd($id);
|
||||||
$machineReservation->delete();
|
$machineReservation->delete();
|
||||||
|
|
||||||
$reservations = WashingReservation::query()->paginate( 20);
|
$reservations = WashingReservation::query()->paginate( 20);
|
||||||
|
@ -265,7 +266,7 @@ class WashingReservationController extends Controller
|
||||||
{
|
{
|
||||||
WashingReservation::query()->where('time', '<', date('Y-m-d H:i:s', strtotime('-1 hour')))->delete();
|
WashingReservation::query()->where('time', '<', date('Y-m-d H:i:s', strtotime('-1 hour')))->delete();
|
||||||
|
|
||||||
$reservations = WashingReservation::query()->join('washing_machines', 'washing_machines.id', '=', 'washing_reservations.machine_id')->join('locations', 'locations.id', '=', 'washing_machines.location_id')->where("user_id", "=", auth()->user()->id)->orderBY('time' , 'asc')->paginate($request->query("limit", 20));
|
$reservations = WashingReservation::query()->where("user_id", "=", auth()->user()->id)->orderBY('time' , 'asc')->paginate($request->query("limit", 20));
|
||||||
|
|
||||||
return Response::detect("washing-reservations.index", [ "reservations" => $reservations]);
|
return Response::detect("washing-reservations.index", [ "reservations" => $reservations]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
<h3>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h3>
|
<h3>{{ \App\WashingMachine::query()->find($reservation->machine_id)->name }}</h3>
|
||||||
<div class="row align-items-center">
|
<div class="row align-items-center">
|
||||||
<span style="font-size: 4vw; white-space: pre-line;"><b>{{__('msg.tid')}}:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}
|
<span style="font-size: 4vw; white-space: pre-line;"><b>{{__('msg.tid')}}:</b> {{ \Illuminate\Support\Facades\Date::createFromTimeStamp(strtotime($reservation->time))->format('d/m/Y \k\l\. H:i') }}
|
||||||
- {{ $reservation->name }}</span>
|
- {{ \App\Location::query()->where('id', '=', \App\WashingMachine::query()->find($reservation->machine_id)->location_id)->first()->name }}</span>
|
||||||
<form class="ml-auto" method="post" action="{{ route("washing-reservations.destroy", [ "washing_reservation" => $reservation ]) }}">
|
<form class="ml-auto" method="post" action="{{ route("washing-reservations.destroy", [ "washing_reservation" => $reservation ]) }}">
|
||||||
@csrf
|
@csrf
|
||||||
@method("delete")
|
@method("delete")
|
||||||
|
|
Loading…
Reference in New Issue