Пример #1
0
 public function index()
 {
     $shop = $this->account();
     $orders = $shop->orders()->take(10)->get();
     /*Product Count*/
     $data['productCount'] = $shop->products()->count();
     $data['activeProductCount'] = $shop->products()->active()->count();
     /*Order Count*/
     $data['cancelledOrderCount'] = $shop->orders()->hasStatus('cancelled')->count();
     $data['pendingOrderCount'] = $shop->orders()->hasStatus('pending')->count();
     $data['processingOrderCount'] = $shop->orders()->hasStatus('processing')->count();
     $data['onrouteOrderCount'] = $shop->orders()->hasStatus('onroute')->count();
     $data['completeOrderCount'] = $shop->orders()->hasStatus('complete')->count();
     $data['needUserActionOrderCount'] = OrderCancellation::active()->by($shop)->count();
     $data['needShopActionOrderCount'] = OrderCancellation::active()->for($shop)->count();
     return view('shop::__shop.home', compact('orders') + $data);
 }