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


PHP Order::getOrders方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $menuOptions = [0 => ["data-letters" => "", "id" => "home", "text" => "Home", "href" => "/"]];
     if (Auth::check()) {
         $user = Auth::user();
         $verifyAdmin = Admin::find($user->id);
         if (isset($verifyAdmin->id)) {
             $users = User::all();
             $fabrics = Fabric::all();
             $data = array("latestOrders" => Order::getOrders(0), "latestUsers" => User::where("confirmed", "=", "0")->orderBy("created_at", "")->take(5)->get(), "user" => $user, "users" => $users, "fabrics" => $fabrics, "orders" => Order::getOrders(0), "confirmed-users" => User::where("confirmed", "=", "1")->orderBy("created_at", "")->take(5)->get(), "admin" => true);
             /*Session::put('paginate', [
                   "confirmed-users"      => 5,
                   "not-confirmed-users"  => 5,
                   "not-confirmed-orders" => 5,
                   "confirmed-orders"     => 5
               ]);*/
             return view("panel.admin-panel")->with("data", $data)->with("user", $user);
         } else {
             $stats = ["orders" => Order::where("user_id", "=", $user->id)->count(), "unconfirmed" => Order::where("user_id", "=", $user->id)->where("status", "=", "not-confirmed")->count(), "confirmed" => Order::where("user_id", "=", $user->id)->where("status", "=", "confirmed")->count(), "latest" => Order::where("user_id", "=", $user->id)->max("created_at")];
             //dd(Order::getOrdersUser($user->id));
             $data = array("orders" => Order::getOrdersUser($user->id, 0), "stats" => $stats, "fabrics" => Fabric::all(), "admin" => false);
             /*Session::put('paginate', [
                   "confirmed-orders"      => 5,
                   "not-confirmed-orders"  => 5, 
               ]);*/
             return view("panel.normal-panel")->with("user", $user)->with("data", $data);
         }
     } else {
         return redirect("/")->with("menuOptions", $menuOptions);
     }
 }
开发者ID:xoscar,项目名称:dnim-inc,代码行数:37,代码来源:UserController.php

示例2: ordersChangeStatus

 public function ordersChangeStatus()
 {
     $this->view['title'] .= 'Panel administracyjny - Zamówienia';
     $statusId = Request::input('order_by');
     $ordersView = ['sID' => $statusId, 'orders' => Order::getOrders($statusId)];
     $view = view('admin/template', $this->view)->nest('content', 'admin/orders', $ordersView);
     $cookie = Cookie::forever('status', Request::input('order_by'));
     return Response::make($view)->withCookie($cookie);
 }
开发者ID:WhiteHalfoat,项目名称:WebShop-sklep-internetowy,代码行数:9,代码来源:AdminController.php

示例3: getPaginate

 public function getPaginate(Request $request)
 {
     if (Auth::check()) {
         $skip = $request->input("skip");
         $type = $request->input("type") != null ? $request->input("type") : "null";
         if ($type == "all" && User::isAdmin(Auth::user())) {
             $orders = Order::getOrders($skip);
             return ["result" => true, "msg" => "Orders found", "orders" => $orders];
         } else {
             $orders = Order::getOrdersUser(Auth::user()->user_id, $skip);
             return ["result" => true, "msg" => "success", "orders" => $orders];
         }
     } else {
         return ["result" => false, "msg" => "Session not found"];
     }
 }
开发者ID:xoscar,项目名称:dnim-inc,代码行数:16,代码来源:OrderController.php


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