public function reset() { $stores = StoreModel::all(); foreach ($stores as $store) { $status = $store->status; $startNo = rand(1, 100); $status->current_queue_no = $startNo; $status->last_queue_no = $startNo; $status->save(); } }
public function index() { $arg = array('departs' => Depart::all(), 'stores' => Store::all()); return View::make('foodorder/open', $arg); }
/** * Display a listing of all active deliveries. * * @return Response */ public function getOverviewOfActive() { return View::make('delivery.active', ['activeDeliveries' => Delivery::active()->get()->sortBy('closing_time'), 'now' => $this->getDateTimeAfterNow(10)->format('Y-m-d H:i:s'), 'stores' => Store::all()]); }
/** * show list of all stores * * @return \Illuminate\View\View */ public function getAll() { return View::make('store.all', ['stores' => Store::all()]); }
public function all() { $stores = Store::all(); return $stores; }
public function edit_product() { $id = Request::segment(4) ? Request::segment(4) : 0; $sub_title = Request::segment(4) ? "Edit Product" : "Add Product"; $product = Product::find($id); $brands = Brand::all(); $stores = Store::all(); $selected_store_id = 0; $selected_department_id = 0; $selected_shelf_id = 0; foreach ($stores as $store) { $selected_store_id = $store->id; break; } if ($product && $product->store_id) { $selected_store_id = $product->store_id; } $departments = Department::where('store_id', $selected_store_id)->get(); foreach ($departments as $department) { $selected_department_id = $department->id; break; } if ($product && $product->department_id) { $selected_department_id = $product->department_id; } $shelves = Shelf::where('department_id', $selected_department_id)->get(); foreach ($shelves as $shelf) { $selected_shelf_id = $shelf->id; break; } return View::make('admin.product_form')->with('title', 'Product')->with('sub_title', $sub_title)->with('product', $product)->with('brands', $brands)->with('stores', $stores)->with('departments', $departments)->with('shelves', $shelves)->with('selected_store_id', $selected_store_id)->with('selected_department_id', $selected_department_id)->with('selected_shelf_id', $selected_shelf_id); }
/** * user statistics * * @return \Illuminate\View\View */ public function getStatistics() { $user = Auth::user(); // favorite stores $allStores = Store::all(); $favoriteStoresBySpending = $allStores->sortByDesc(function ($store) use($user) { return $store->spendByUser($user); })->take(5); $favoriteStoresByOrderCount = $allStores->sortByDesc(function ($store) use($user) { return $store->ordersByUser($user); })->take(5); return View::make('user.statistics', ['favoriteStoresBySpending' => $favoriteStoresBySpending, 'favoriteStoresByOrderCount' => $favoriteStoresByOrderCount]); }