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


PHP Order::whereRaw方法代码示例

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


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

示例1: index

 /**
  * Show the application dashboard.
  *
  * @return Response
  */
 public function index()
 {
     $private = Order::whereRaw('(status = 1 OR status = 2) AND prio = 0')->orderBy('order_id', 'desc')->whereHas("customer", function ($query) {
         $query->where("business", "=", '0');
     })->get();
     $company = Order::whereRaw('(status = 1 OR status = 2) AND prio = 0')->orderBy('order_id', 'desc')->whereHas("customer", function ($query) {
         $query->where("business", "=", '1');
     })->get();
     $prio = Order::where('prio', '=', '1')->whereRaw('(status = 1 OR status = 2)')->orderBy('order_id')->with("customer")->get();
     $finished = Order::whereStatus('4')->with('customer')->get();
     return view('home', compact('private', 'company', 'prio', 'finished'));
 }
开发者ID:znittzel,项目名称:datianew,代码行数:17,代码来源:HomeController.php

示例2: getReport

 public function getReport(Request $request)
 {
     $this->page->title = 'Заказы такси';
     $this->page->desc = 'Текущие заказы';
     // ПОЛЬЗОВАТЕЛЬ Текущие заказы
     $user = User::where('company', '=', $request->input('company'))->get()->first();
     $this->data['company'] = $user->company;
     $this->data['date_from'] = $request->input('date_from');
     $this->data['date_to'] = $request->input('date_to');
     $this->data['orders'] = Order::whereRaw('user_id = ' . $user->id . ' AND (departure_time > now() OR arrivals_time > now())')->where('created_at', '>=', date("Y-m-d 00:00:00", strtotime($request->input('date_from'))))->where('created_at', '<=', date("Y-m-d 23:59:59", strtotime($request->input('date_to'))))->orderBy('created_at', 'DESC')->get();
     // не олачено
     $this->data['nopay_orders'] = Order::whereRaw('user_id = ' . $user->id . ' AND payment_status = 0 AND (departure_time < now() AND arrivals_time < now())')->where('created_at', '>=', date("Y-m-d 00:00:00", strtotime($request->input('date_from'))))->where('created_at', '<=', date("Y-m-d 23:59:59", strtotime($request->input('date_to'))))->orderBy('created_at', 'DESC')->get();
     // отображение
     return $this->render('reports.list-report');
 }
开发者ID:pz6tnk,项目名称:laravel-CRM,代码行数:15,代码来源:ReportsController.php

示例3: getArchive

 /**
  * Архив заказов
  *
  * @return \Illuminate\View\View
  */
 public function getArchive()
 {
     $this->page->title = 'Заказы такси';
     $this->page->desc = 'Архив заказов';
     // АДМИНИСТРАТОР Текущие заказы
     if (Sentinel::inRole('admin')) {
         $this->data['orders'] = Order::whereRaw('order_status = 3 AND payment_status = 1 AND (departure_time < now() and arrivals_time < now())')->orderBy('created_at', 'DESC')->get();
     } else {
         $this->data['orders'] = Order::whereRaw('order_status = 3 AND payment_status = 1 AND (departure_time < now() and arrivals_time < now())')->where('user_id', Sentinel::getUser())->orderBy('created_at', 'DESC')->get();
     }
     // АДМИНИСТРАТОР отображение
     return $this->render('order.list-archive');
 }
开发者ID:pz6tnk,项目名称:laravel-CRM,代码行数:18,代码来源:OrderController.php


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