D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
tattooscyy
/
test
/
app
/
Http
/
Controllers
/
Filename :
SaloonController.php
back
Copy
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Saloon; use App\Schedule; use App\ScheduleExcept; use App\Libs\Endhour; class SaloonController extends Controller { public function getIndex(){ $saloons = Saloon::orderBy('name')->get(); return view('saloons', compact('saloons')); } public function getOne($id=null){ $exs = ScheduleExcept::where('saloon_id', $id)->get(); $ex = []; foreach($exs as $one){ $ex[$one->day] = $one->hours; } $saloon = Saloon::find($id); $time = Schedule::where('status', 'saloon')->where('saloon_id', $saloon->id)->orderBy('id','DESC')->first(); $days = unserialize($time->days); $hours = unserialize($time->hours); $h = end($hours); $time_obj = new Endhour(); $hhhhh = $time_obj->fromTime($h); return view('saloon', compact('saloon','hours','days', 'hhhhh', 'ex')); } }