Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function meal_shift(){
- //
- // $breakfasts = collect($breakfasts);
- $all_shift=Order::all();
- // $breakfasts=Order::where(['shift_id'=>'lunch'])->get();
- $breakfasts=Order::where('shift_id','=','breakfast')->count();
- $meal_shift = json_decode($breakfasts);
- dd($meal_shift);
- // $breakfasts->count();
- $breakfasts=Order::where('shift_id','breakfast')->count();
- $lunchs=Order::where('shift_id','lunch')->count();
- //
- // $results= DB::table('orders')
- // ->select('shift_id', DB::raw('count(*) as count'))
- // ->groupBy('shift_id')
- // ->get();
- // $totals = DB::table('orders')
- // ->selectRaw('count(*) as total')
- // ->selectRaw("count(case when shift_id = 'breakfast' then 1 end) as breakfast")
- // ->selectRaw("count(case when shift_id = 'lunch' then 1 end) as lunch")
- // ->selectRaw("count(case when shift_id = 'dinnar' then 1 end) as dinnar")
- // ->selectRaw("count(case when shift_id = 'snacks' then 1 end) as snacks")
- // ->first();
- return view('tnws.order.meal_shift',compact('breakfasts','meal_qtys','dinnars','snacks','datas','totals','results'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement