Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. public function meal_shift(){
  2. //
  3. // $breakfasts = collect($breakfasts);
  4. $all_shift=Order::all();
  5.  
  6. // $breakfasts=Order::where(['shift_id'=>'lunch'])->get();
  7. $breakfasts=Order::where('shift_id','=','breakfast')->count();
  8. $meal_shift = json_decode($breakfasts);
  9. dd($meal_shift);
  10.  
  11. // $breakfasts->count();
  12.  
  13. $breakfasts=Order::where('shift_id','breakfast')->count();
  14. $lunchs=Order::where('shift_id','lunch')->count();
  15. //
  16. // $results= DB::table('orders')
  17. // ->select('shift_id', DB::raw('count(*) as count'))
  18. // ->groupBy('shift_id')
  19. // ->get();
  20. // $totals = DB::table('orders')
  21. // ->selectRaw('count(*) as total')
  22. // ->selectRaw("count(case when shift_id = 'breakfast' then 1 end) as breakfast")
  23. // ->selectRaw("count(case when shift_id = 'lunch' then 1 end) as lunch")
  24. // ->selectRaw("count(case when shift_id = 'dinnar' then 1 end) as dinnar")
  25. // ->selectRaw("count(case when shift_id = 'snacks' then 1 end) as snacks")
  26. // ->first();
  27.  
  28. 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