本文整理汇总了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]);
}
示例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.');
}
}
示例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());
}
示例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.";
}
}
示例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());
}
示例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');
}
}
示例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'));
}
示例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));
}