当前位置: 首页>>代码示例>>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;未经允许,请勿转载。