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


PHP Order::whereIn方法代碼示例

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


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

示例1: index

 public function index($sort = 'departure')
 {
     $this->page->title = 'Заказы такси';
     $this->page->desc = 'Текущие заказы';
     $this->data['sort'] = $sort;
     if (Sentinel::inRole('admin')) {
         // АДМИНИСТРАТОР Новые и редактированные заказы
         $this->data['orders_new'] = Order::whereIn('order_status', array(1, 2))->orderBy('updated_at', 'desc')->get();
         // АДМИНИСТРАТОР Текущие заказы
         if ($sort == 'arrivals') {
             // Сортировка по прилету
             $this->data['orders'] = Order::whereRaw('order_status = 3 AND (departure_time > now() OR arrivals_time > now())')->orderBy('arrivals_time')->get();
         } else {
             // Сортировка по вылету
             $this->data['orders'] = Order::whereRaw('order_status = 3 AND (departure_time > now() OR arrivals_time > now())')->orderBy('departure_time')->get();
         }
         // не олачено
         $this->data['nopay_orders'] = Order::whereRaw('order_status = 3 AND payment_status = 0 AND (departure_time < now() and arrivals_time < now())')->orderBy('departure_time')->get();
         $news = News::all();
         //            \Session::flash('messages', count($news));
         foreach ($news as $key => $val) {
             \Session::flash('flash_message_' . $key, $val->body);
         }
         // АДМИНИСТРАТОР отображение
         return $this->render('order.list-admin');
     } else {
         // ПОЛЬЗОВАТЕЛЬ Текущие заказы
         $this->data['orders'] = Order::whereRaw('user_id = ' . $this->user->id . ' AND (departure_time > now() OR arrivals_time > now())')->orderBy('created_at', 'DESC')->get();
         // не олачено
         $this->data['nopay_orders'] = Order::whereRaw('user_id = ' . $this->user->id . ' AND payment_status = 0 AND (departure_time < now() AND arrivals_time < now())')->orderBy('created_at', 'DESC')->get();
         $news = News::all();
         //            \Session::flash('messages', count($news));
         foreach ($news as $key => $val) {
             \Session::flash('flash_message_' . $key, $val->body);
         }
         // ПОЛЬЗОВАТЕЛЬ отображение
         return $this->render('order.list-user');
     }
 }
開發者ID:pz6tnk,項目名稱:laravel-CRM,代碼行數:39,代碼來源:OrderController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $me = \Auth::user()->load('clients');
     $clients = $me->clients->pluck('id');
     return \App\Order::whereIn('client_id', $clients)->whereNull('waiter_id')->orderBy('id', 'desc')->get()->load('client', 'items.food');
 }
開發者ID:halidovz,項目名稱:restful,代碼行數:11,代碼來源:WaiterOrderController.php

示例3: processreturn

 public function processreturn(Request $request)
 {
     $this->validate($request, ['products' => 'required', 'name' => 'required', 'email' => 'required|email', 'mobile' => 'required|digits:10', 'address' => 'required', 'reason' => 'required']);
     $order_ids = $request->get('products');
     $orders = Order::whereIn('id', $order_ids)->get();
     $user = Sentinel::check();
     $user = User::findorfail($user->id);
     $return_inputs = ['user_id' => $user->id, 'name' => $request->get('name'), 'email' => $request->get('email'), 'mobile' => $request->get('mobile'), 'address' => $request->get('address'), 'area_id' => $user->area_id, 'reason' => $request->get('reason'), 'status' => 'Booked'];
     //dd($return_inputs);
     $return = Orderreturn::Create($return_inputs);
     if ($return) {
         $returns = [];
         foreach ($orders as $order) {
             array_push($returns, ['order_id' => $order->id, 'return_id' => $return->id]);
         }
         DB::table('order_return')->insert($returns);
     }
     $notification = "Sorry! We regret you did not like these products.These products you have selected has been registered for return. Our staff will reach to you and receive those products. Kindly dont not consume the product and make it ready for pickup. Thank you.";
     return view('site.notification', compact('notification'));
 }
開發者ID:axicraw,項目名稱:tropara,代碼行數:20,代碼來源:PagesController.php


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