当前位置: 首页>>代码示例>>PHP>>正文


PHP Order::orderBy方法代码示例

本文整理汇总了PHP中Order::orderBy方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::orderBy方法的具体用法?PHP Order::orderBy怎么用?PHP Order::orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Order的用法示例。


在下文中一共展示了Order::orderBy方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getList

 public function getList($date)
 {
     $limit = 12;
     if ($date == 'today') {
         $datename = "Bu <u>gün</u>e ait olan";
         $list = Order::orderBy('id', 'desc')->where('status', 1)->where('days', date('Y-m-d'))->paginate($limit);
     } else {
         if ($date == 'month') {
             $datename = "Bu <u>ay</u>a ait olan";
             $list = Order::orderBy('id', 'desc')->where('status', 1)->where('months', date('Y-m'))->paginate($limit);
         } else {
             if ($date == 'year') {
                 $datename = "Bu <u>yıl</u>a ait olan";
                 $list = Order::orderBy('id', 'desc')->where('status', 1)->where('years', date('Y'))->paginate($limit);
             } else {
                 $datename = "Tüm";
                 $list = Order::orderBy('id', 'desc')->where('status', 1)->paginate($limit);
             }
         }
     }
     $order_years = Order::where('years', date('Y'))->get();
     $order_months = Order::where('months', date('Y-m'))->get();
     $order_days = Order::where('days', date('Y-m-d'))->get();
     $order_all = Order::all();
     return View::make('order.list', compact('list', 'order_years', 'order_months', 'order_days', 'order_all'))->with(['title' => 'Siparişler', 'count_static' => true, 'date_visible' => true, 'price_all' => 0, 'datetime' => $date, 'datename' => $datename]);
 }
开发者ID:osmanyilmazco,项目名称:ordermanager,代码行数:26,代码来源:OrderController.php

示例2: searchOrder

 public function searchOrder()
 {
     Log::debug('Entering AdminController::searchOrder() method... GET array: ' . print_r($_GET, TRUE));
     $searchCriteria = trim(urldecode(Input::get('search_order')));
     if (strlen($searchCriteria) > 2) {
         $orders = array();
         $criteria = array_map("trim", explode(',', $searchCriteria));
         $query = Order::orderBy('id', 'ASC');
         foreach ($criteria as $key => $value) {
             $query->orWhere('id', '=', $value);
         }
         $orders = $query->remember(5)->get();
         Log::debug('Order search results: ' . print_r($orders, TRUE));
         if (count($orders) == 1) {
             return Redirect::route('orders.show', $orders[0]->id);
         } elseif (count($orders) > 1) {
             $this->layout->content = View::make('admin.orders', compact('orders'));
         } else {
             return Redirect::back()->with('message', 'No <em><strong>orders</strong></em> found for search criteria: "' . $searchCriteria . '".');
         }
     } else {
         return Redirect::back()->with('message', 'Insufficent search criteria.');
     }
 }
开发者ID:marciocamello,项目名称:laravel-ecommerce,代码行数:24,代码来源:AdminController.php

示例3: getDetails

 /**
  *  This function responses to
  *  the get request of /admin/employee/details/{id}
  *  and view employee respect to id
  */
 public function getDetails($id, $msg = null)
 {
     $employee = Employee::find($id);
     $employee->DOB = DateFormat::show($employee->DOB);
     if (!empty($msg) && $msg == 1) {
         return View::make('adminArea.employee.details')->with('employee', $employee)->with('orders', Order::orderBy('from', 'desc')->get())->with('success', "Order has been deactivated successfully");
     }
     return View::make('adminArea.employee.details')->with('employee', $employee)->with('orders', Order::orderBy('from', 'desc')->get());
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:14,代码来源:EmployeeController.php

示例4: viewAllOrders

 public function viewAllOrders()
 {
     $today = Carbon\Carbon::toDay()->toDateTimeString();
     if (Auth::user()->role == "admin" || Auth::user()->role == "cashier") {
         $orders_today = Order::where('created_at', '>=', Carbon\Carbon::now()->startOfDay())->orderBy('created_at', 'desc')->paginate(10);
         $orders_all = Order::orderBy('created_at', 'desc')->paginate(10);
         return View::make('order.list')->with(array('orders_today' => $orders_today, 'orders_all' => $orders_all));
     } else {
         echo "Access Denied. You have no permission to access this area.";
     }
 }
开发者ID:emrys96,项目名称:sizzle-pizza,代码行数:11,代码来源:OrderController.php

示例5: getDetails

 /**
  *  This function responses to
  *  the get request of /admin/movie/details/{id}
  *  and view movie respect to id
  */
 public function getDetails($id, $msg = null)
 {
     $movie = Movie::find($id);
     if (!empty($msg) && $msg == 1) {
         return View::make('adminArea.movie.details')->with('movie', $movie)->with('orders', Order::orderBy('from', 'desc')->get())->with('success', "Order has been deactivated successfully");
     }
     return View::make('adminArea.movie.details')->with('movie', $movie)->with('orders', Order::orderBy('from', 'desc')->get());
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:13,代码来源:MovieController.php

示例6: getAllActiveOrder

 /**
  *  This function responses to
  *  the get request of /admin/order/active
  *  and show all active order as list
  */
 public function getAllActiveOrder($msg = null)
 {
     if (!empty($msg) && $msg == 1) {
         return View::make('adminArea.order.active')->with('orders', Order::orderBy('id', 'desc')->get())->with('success', 'Order has been deactivated successfully');
     }
 }
开发者ID:madiarsa,项目名称:DVD-Rental,代码行数:11,代码来源:OrderController.php

示例7: index

 /**
  * Display a listing of orders
  *
  * @return Response
  */
 public function index()
 {
     $orders = Order::orderBy('created_at', 'desc')->paginate(10);
     return View::make('admin.orders.index', compact('orders'));
 }
开发者ID:shittyc0de,项目名称:AplikasiLC,代码行数:10,代码来源:OrdersController.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $orders = Order::orderBy('user_id')->get();
     return View::make("admin.order.list", array("orders" => $orders));
 }
开发者ID:elioth010,项目名称:carretilla_online,代码行数:10,代码来源:OrderController.php


注:本文中的Order::orderBy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。