Ejemplo n.º 1
0
 public function index(Request $request)
 {
     // 获取排序条件
     $orderColumn = $request->get('sort_up', $request->get('sort_down', 'created_at'));
     $direction = $request->get('sort_up') ? 'asc' : 'desc';
     $stores = Store::orderBy($orderColumn, $direction)->paginate(999);
     return view('mobile.stores', compact('stores', 'query'));
 }
Ejemplo n.º 2
0
 /**
  * Edit snapshot
  *
  * @param  Request  $request
  * @return Response
  */
 public function edit(Request $request, Snapshot $snapshot)
 {
     $stores = Store::orderBy('name')->lists('name', 'id');
     return view('snapshots.input', ['stores' => $stores, 'snapshot' => $snapshot]);
 }
Ejemplo n.º 3
0
 /**
  * Display a list of all of the products
  *
  * @param  Request  $request
  * @return Response
  */
 public function index(Request $request)
 {
     $stores = Store::orderBy('name')->lists('name', 'id');
     $sources = Source::orderBy('name')->lists("name", 'id');
     $query = Product::orderBy('name', 'asc');
     if ($request->store) {
         $query->where('store_id', $request->store);
     }
     if (isset($request->status) && $request->status != '') {
         if ($request->status == 3) {
             $query->where('quantity_sold', '>', 0);
         } else {
             $query->where('product_status', $request->status);
         }
     }
     if ($request->source) {
         $query->where('source_id', $request->source);
     }
     if ($request->from_date) {
         $query->where('updated_at', '>=', date('Y-m-d', strtotime($request->from_date)));
     }
     if ($request->to_date) {
         $query->where('updated_at', '<=', date('Y-m-d', strtotime('+1 day', strtotime($request->to_date))));
     }
     $products = $query->get();
     return view('products.index', ['products' => $products, 'statuses' => $this->product_statuses, 'stores' => $stores, 'sources' => $sources]);
 }
Ejemplo n.º 4
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $stores = Store::orderBy('store')->get();
     return view('store.index', compact('stores'));
 }
Ejemplo n.º 5
0
 /**
  * Display a list of all of the expenses
  *
  * @param  Request  $request
  * @return Response
  */
 public function index(Request $request)
 {
     $stores = Store::orderBy('name')->lists('name', 'id');
     $query = Expense::orderBy('purchase_date', 'desc');
     if ($request->store) {
         $query->where('store_id', $request->store);
     }
     if ($request->from_date) {
         $query->where('purchase_date', '>=', date('Y-m-d', strtotime($request->from_date)));
     }
     if ($request->to_date) {
         $query->where('purchase_date', '<=', date('Y-m-d', strtotime($request->to_date)));
     }
     $expenses = $query->get();
     return view('expenses.index', ['expenses' => $expenses, 'stores' => $stores]);
 }
Ejemplo n.º 6
0
 /**
  * Display a list of all of the stores
  *
  * @param  Request  $request
  * @return Response
  */
 public function index(Request $request)
 {
     $stores = Store::orderBy('name', 'asc')->get();
     return view('stores.index', ['stores' => $stores]);
 }