本文整理汇总了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'));
}
示例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' => 'لیست درخواستها']);
}
示例3: index
public function index()
{
$orders = Order::orderBy('id', 'desc')->paginate(8);
//created_at
//dd($orders);
return view('admin.order.index', compact('orders'));
}
示例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);
}
示例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'));
}
示例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
));*/
}
示例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'));
}
示例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'));
}
示例9: getAll
/**
* Get all of the orders
*/
public function getAll()
{
return Order::orderBy('created_at', 'desc')->get();
}
示例10: dashboard
public function dashboard()
{
$data = ['printers' => Printer::all(), 'orders' => Order::orderBy('created_at', 'desc')->get(), 'test' => 'Test'];
return view('dashboard', $data);
}
示例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'));
}
示例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']);
示例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]);
}
示例14: getOrderList
public function getOrderList(Order $order)
{
$orders = $order->orderBy('created_at', 'DESC')->paginate(25);
return view('orders.lists')->with(compact('orders'));
}
示例15: findLastSavedId
/**
* find the id of the last saved order
*
* @return mixed
*/
public function findLastSavedId()
{
return Order::orderBy('updated_at', 'desc')->first()->id;
}