當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Order::orderBy方法代碼示例

本文整理匯總了PHP中app\Order::orderBy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Order::orderBy方法的具體用法?PHP Order::orderBy怎麽用?PHP Order::orderBy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\Order的用法示例。


在下文中一共展示了Order::orderBy方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: index

 public function index()
 {
     $users = Order::all();
     $orders = Order::orderBy('id', 'desc')->paginate(5);
     //dd($orders);
     return view('admin.order.index', compact('orders', 'users'));
 }
開發者ID:kazamax,項目名稱:tienda,代碼行數:7,代碼來源:OrderController.php

示例2: adminIndex

 public function adminIndex()
 {
     //$orders=Order::orderBy('id','DESC')->get();
     $orders = Order::orderBy('id', 'desc')->paginate(Config::get('nafisConfig.perPage'));
     //dd($orders);
     return view('admin.orderAdminIndex', compact('orders'))->with(['title' => 'لیست درخواستها']);
 }
開發者ID:slifer2015,項目名稱:tarabar,代碼行數:7,代碼來源:OrderController.php

示例3: index

 public function index()
 {
     $orders = Order::orderBy('id', 'desc')->paginate(8);
     //created_at
     //dd($orders);
     return view('admin.order.index', compact('orders'));
 }
開發者ID:aleksAE,項目名稱:Store-Laravel5.1,代碼行數:7,代碼來源:OrderController.php

示例4: orders

 public function orders(Request $request)
 {
     if ($request->search) {
         $search = $request->search;
         $this->data['search'] = $search;
         $orders = Order::where('name', 'like', '%' . $search . '%')->orWhere('email', 'like', '%' . $search . '%')->orWhere('phone', 'like', '%' . $search . '%')->orderBy('created_at', 'desc')->paginate(50);
     } else {
         $orders = Order::orderBy('created_at', 'desc')->paginate(50);
         $this->data['search'] = null;
     }
     $this->data['current_tab'] = 37;
     $this->data['orders'] = $orders;
     $this->data['last_page'] = $orders->lastPage();
     $this->data['current_page'] = $orders->currentPage();
     return view('manage.order.list', $this->data);
 }
開發者ID:Kaelcao,項目名稱:colormev2,代碼行數:16,代碼來源:OrderController.php

示例5: getIndex

 public function getIndex()
 {
     $now = Carbon::now('Asia/Kuala_Lumpur');
     $monthStart = $now->startOfMonth();
     $monthEnd = $now->endOfMonth();
     $tempahan = Order::orderBy('created_at', $monthStart);
     // where('created_at', '>=', Carbon::now()->startOfMonth())->get()
     $kato = Category::whereHas('transaction', function ($query) {
         $query->where('qty', '>', 0);
         $query->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfYear());
     })->get();
     $katoo = Category::whereHas('transaction', function ($query) {
         $query->where('qty', '>', 0);
         $query->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfMonth());
     })->get();
     $overall = Transaction::select('id', 'created_at', 'month', DB::raw('sum(qty) as total'))->groupBy(DB::raw('MONTH(month)'))->orderBy('created_at', 'asc')->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfYear())->get();
     $testo = Transaction::select('id', 'month')->groupBy(DB::raw('MONTH(month)'))->orderBy('month', 'asc');
     $tahun = Carbon::now('Asia/Kuala_Lumpur')->startOfYear();
     $tran = Transaction::all();
     $tops = Transaction::orderBy('qty', 'desc')->groupBy('product_id')->limit(5)->where('created_at', '>=', Carbon::now('Asia/Kuala_Lumpur')->startOfWeek())->get();
     return view('a.index', compact('kato', 'katoo', 'tops', 'overall', 'tahun', 'testo'))->with('tempahan', $tempahan)->with('trans', $tran)->with('args', Order::all())->with('ris', Order::sum('total_purchase'))->with('name', $kato->lists('name'))->with('namo', $katoo->lists('name'));
 }
開發者ID:alongmuaz,項目名稱:laravel-fyp-cart,代碼行數:22,代碼來源:AdminController.php

示例6: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     // For this week's batch of items
     $requiredItems = array();
     if (isset($_GET['all'])) {
         // Want all orders for some reason, use with caution
         $orders = Order::orderBy('id', 'desc')->get();
         foreach ($orders as $order) {
             // Parse it so that the template knows how to use it
             $order->item_array = JSON_decode($order->item_array);
         }
     } else {
         // Get unpaid orders by default
         $orders = Order::where('paid', '=', 0)->orderBy('id', 'desc')->get();
         // Calculate totals for this batch
         foreach ($orders as $order) {
             $order->item_array = JSON_decode($order->item_array);
             foreach ($order->item_array as $item) {
                 if (array_key_exists($item->name, $requiredItems)) {
                     // The item was already added, just add the quantity
                     $requiredItems[$item->name] += $item->qty;
                 } else {
                     // The item isn't added yet, make a new entry
                     $requiredItems[$item->name] = $item->qty;
                 }
             }
         }
     }
     return Response::json(array('orders' => $orders, 'requiredItems' => $requiredItems));
     /*
             return view('orders.index')->with(array(
                 'orders' => $orders,
                 'requiredItems' => $requiredItems
             ));*/
 }
開發者ID:BrynnLawson,項目名稱:smarka,代碼行數:41,代碼來源:OrdersController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $order = Order::orderBy('transaction_id', 'asc')->paginate(5);
     return view('orders.index', compact('order'));
 }
開發者ID:hoangvu2015,項目名稱:laravel_totnghiep,代碼行數:10,代碼來源:OrderController.php

示例8: index

 /**
  * Method for showing a list of orders.
  *
  * @return \Illuminate\View\View
  */
 public function index()
 {
     $orders = Order::orderBy('id', 'DESC')->paginate(10);
     return view('ecomm.admin.orders.index', compact('orders'));
 }
開發者ID:JimiOhrid,項目名稱:shopStore,代碼行數:10,代碼來源:OrdersController.php

示例9: getAll

 /**
  * Get all of the orders
  */
 public function getAll()
 {
     return Order::orderBy('created_at', 'desc')->get();
 }
開發者ID:WilkMat,項目名稱:Zadanie-2,代碼行數:7,代碼來源:OrderRepository.php

示例10: dashboard

 public function dashboard()
 {
     $data = ['printers' => Printer::all(), 'orders' => Order::orderBy('created_at', 'desc')->get(), 'test' => 'Test'];
     return view('dashboard', $data);
 }
開發者ID:dericcain,項目名稱:toner-order,代碼行數:5,代碼來源:PrinterController.php

示例11: index

 public function index()
 {
     // $articles= Articles::where('user_id','=','2')->get();  izvlacenje pomocu user_id iz druge tabele
     $orders = Order::orderBy('created_at')->get();
     return View::make('articles.index', compact('orders'));
 }
開發者ID:Niiwill,項目名稱:pizzaApp,代碼行數:6,代碼來源:AdminController.php

示例12: function

Route::get('/', function () {
    return view('home');
});
// Registration routes...
Route::get('auth/register', 'Auth\\AuthController@getRegister');
Route::post('auth/register', 'Auth\\AuthController@postRegister');
// Authentication routes...
Route::get('auth/login', 'Auth\\AuthController@getLogin');
Route::post('auth/login', 'Auth\\AuthController@postLogin');
Route::get('auth/logout', 'Auth\\AuthController@getLogout');
// Password reset link request routes...
Route::get('password/email', 'Auth\\PasswordController@getEmail');
Route::post('password/email', 'Auth\\PasswordController@postEmail');
// Password reset routes...
Route::get('password/reset/{token}', 'Auth\\PasswordController@getReset');
Route::post('password/reset', 'Auth\\PasswordController@postReset');
// Ressource REST API routes
Route::resource('order', 'OrderController', ['only' => ['store', 'index', 'create', 'show']]);
Route::resource('payment', 'PaymentController', ['only' => ['store', 'show']]);
Route::resource('customer', 'CustomerController', ['only' => ['store', 'show']]);
// Admin page
Route::get('/admin', ['middleware' => 'auth', function () {
    /*
     * Displays a table of all direct debit payments requested so far 
     */
    $orders = Order::orderBy('group', 'asc')->with('payment', 'customer')->get()->all();
    $payments = Payment::all();
    $customers = Customer::all();
    return view('admin', ['orders' => $orders, 'payments' => $payments, 'customers' => $customers]);
}]);
Route::controllers(['password' => 'Auth\\PasswordController']);
開發者ID:Balauue,項目名稱:komilitona,代碼行數:31,代碼來源:routes.php

示例13: listOrders

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function listOrders()
 {
     //
     $orders = \App\Order::orderBy('created_at', "desc")->paginate(15);
     return view("admin.orders.index", ['orders' => $orders]);
 }
開發者ID:susmithageorge,項目名稱:aslu_order_system,代碼行數:11,代碼來源:AdminController.php

示例14: getOrderList

 public function getOrderList(Order $order)
 {
     $orders = $order->orderBy('created_at', 'DESC')->paginate(25);
     return view('orders.lists')->with(compact('orders'));
 }
開發者ID:BarkaBoss,項目名稱:TheHex,代碼行數:5,代碼來源:OrderController.php

示例15: findLastSavedId

 /**
  * find the id of the last saved order
  *
  * @return mixed
  */
 public function findLastSavedId()
 {
     return Order::orderBy('updated_at', 'desc')->first()->id;
 }
開發者ID:slawisha,項目名稱:computer-shop,代碼行數:9,代碼來源:OrderRepository.php


注:本文中的app\Order::orderBy方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。