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


PHP Order::all方法代码示例

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


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

示例1: ProductPrices

 public static function ProductPrices()
 {
     $param = func_get_args();
     if (@$param[0] != null) {
         if ($param[0] == 'todays') {
             $orders = Order::where('days', date('Y-m-d'))->get();
         } else {
             if ($param[0] == 'months') {
                 $orders = Order::where('months', date('Y-m'))->get();
             } else {
                 if ($param[0] == 'years') {
                     $orders = Order::where('years', date('Y'))->get();
                 } else {
                     $orders = Order::all();
                 }
             }
         }
         if (count($orders) > 0) {
             $priceall = 0;
             foreach ($orders as $order) {
                 $otplist = OrderToProduct::where('order_id', $order->id)->get();
                 foreach ($otplist as $value) {
                     $priceall += $value->number * self::ProductInfo($value->product_id, 'price');
                 }
             }
             return $priceall;
         } else {
             return 0;
         }
     } else {
         return 0;
     }
 }
开发者ID:osmanyilmazco,项目名称:ordermanager,代码行数:33,代码来源:Astald.php

示例2: 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]);
 }
开发者ID:osmanyilmazco,项目名称:ordermanager,代码行数:26,代码来源:OrderController.php

示例3: index

 public function index()
 {
     require 'models/product.php';
     require_once 'models/order_detail.php';
     $orders = Order::all();
     require_once 'views/orders/index.php';
 }
开发者ID:Hield,项目名称:e-commerce,代码行数:7,代码来源:orders_controller.php

示例4: getIndex

 public function getIndex()
 {
     $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('home', compact('order_years', 'order_months', 'order_days', 'order_all'))->with('title', 'Anasayfa');
 }
开发者ID:osmanyilmazco,项目名称:ordermanager,代码行数:8,代码来源:HomeController.php

示例5: listOfBuyerOrderCakes

 public function listOfBuyerOrderCakes()
 {
     //  $buyer = Buyer::orderBy('created_at', 'desc')->first();
     //  $name = $buyer->name;
     // $order = Order::where('buyersName', '=', $name)->get();
     // $cakes = Cake::all();
     //$order = DB::SELECT(DB::RAW("SELECT * FROM order"));
     $orders = Order::all();
     // var_dump($order);
     return View::make('myaccountBuyer', ['orders' => $orders]);
 }
开发者ID:jeraldpunx,项目名称:3dCakeMaker,代码行数:11,代码来源:BuyerController.php

示例6: delivery

 public function delivery()
 {
     $djt = Delivery::with('employee')->join('tblOrders', function ($join) {
         $join->on('tblDeliveries.strOrdDlvry', '=', 'tblOrders.strOrdersID');
     })->join('tblSuppliers', function ($join3) {
         $join3->on('tblOrders.strSupplID', '=', 'tblSuppliers.strSuppID');
     })->get();
     $ids = DB::table('tblDeliveries')->select('strDlvryID')->orderBy('updated_at', 'desc')->orderBy('strDlvryID', 'desc')->take(1)->get();
     $ID = $ids["0"]->strDlvryID;
     $newID = $this->smart($ID);
     $orders = Order::all();
     $op = OrderProduct::all();
     $ord = Order::lists('strOrdersID', 'strOrdersID');
     $products = Product::lists('strProdName', 'strProdID');
     $data = array('orders' => $ord, 'products' => $products);
     return View::make('delivery')->with('djt', $djt)->with('newID', $newID)->with('orders', $orders)->with('op', $op)->with('data', $data);
 }
开发者ID:ExperimentalGroup,项目名称:inventoryfinal,代码行数:17,代码来源:HomeController.php

示例7: run

 public function run()
 {
     $faker = $this->getFaker();
     $orders = Order::all();
     $products = Product::all()->toArray();
     foreach ($orders as $order) {
         $used = [];
         for ($i = 0; $i < rand(1, 5); $i++) {
             $product = $faker->randomElement($products);
             if (!in_array($product["id"], $used)) {
                 $id = $product["id"];
                 $price = $product["price"];
                 $quantity = rand(1, 3);
                 OrderItem::create(["order_id" => $order->id, "product_id" => $id, "price" => $price, "quantity" => $quantity]);
                 $used[] = $product["id"];
             }
         }
     }
 }
开发者ID:rossli,项目名称:lam-laravel5-shop,代码行数:19,代码来源:OrderItemTableSeeder.php

示例8: getIndex

 public function getIndex()
 {
     $super = 0;
     $vendor = 0;
     if (isset($_GET['vendor']) && $_GET['vendor']) {
         $affected = Order::where('vendor_id', '=', Auth::user()->id)->update(array('notification' => 0));
         $vendor = 1;
         $orders = Order::where('vendor_id', '=', Auth::user()->id)->get();
         return View::make('orders.index')->with('orders', $orders)->with('super', $super)->with('vendor', $vendor);
     } else {
         if (isset($_GET['super']) && $_GET['super'] && Auth::user()->isSuper) {
             $super = 1;
             $orders = Order::all();
             $ordermasters = Ordermaster::all();
             return View::make('orders.index')->with('orders', $orders)->with('ordermasters', $ordermasters)->with('super', $super)->with('vendor', $vendor);
         } else {
             $data_set = DB::table('orders')->leftJoin('ratings', 'orders.order_id', '=', 'ratings.odr_id')->where('orders.user_id', '=', Auth::user()->id)->get();
             return View::make('orders.userindex')->with('orders', $data_set)->with('super', $super)->with('vendor', $vendor);
         }
     }
     //return View::make('orders.index');
 }
开发者ID:abaecor,项目名称:funfest,代码行数:22,代码来源:OrdersController.php

示例9: orders

 /**
  * @before _secure
  */
 public function orders()
 {
     $this->seo(array("title" => "Orders", "view" => $this->getLayoutView()));
     $view = $this->getActionView();
     $orders = array();
     $os = Order::all(array("user_id = ?" => $this->user->id), array("id", "amount", "ref_id"), "created", "desc");
     foreach ($os as $o) {
         $title = array();
         $appointments = Appointment::all(array("order_id = ?" => $o->id), array("service_id", "start", "end", "patient_id"));
         foreach ($appointments as $a) {
             $service = Service::first(array("id = ?" => $a->service_id), array("property", "property_id"));
             $model = ucfirst($service->property);
             $item = $model::first(array("id = ?" => $service->property_id), array("title"));
             $title[] = $item->title;
             $start = $a->start;
             $end = $a->end;
             $patient_id = $a->patient_id;
         }
         $patient = User::first(array("id = ?" => $patient_id), array("name"));
         array_push($orders, array("item" => implode(", ", $title), "amount" => $o->amount, "id" => $o->id, "ref_id" => $o->ref_id, "patient" => $patient->name, "start" => $start, "end" => $end));
     }
     $view->set("orders", $orders);
 }
开发者ID:HLitmus,项目名称:WebApp,代码行数:26,代码来源:finance.php

示例10: get_export

/**
 * get_export 
 * saved to public folder
 * 
 * @access public
 * @return void
 */
function get_export()
{
    $table = Order::all();
    $file = fopen('file.csv', 'w');
    foreach ($table as $row) {
        fputcsv($file, $row->toarray());
    }
    fclose($file);
    //return Redirect::to('consolidated');
}
开发者ID:benchan,项目名称:cart,代码行数:17,代码来源:routes.php

示例11: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $orders = Order::all();
     return View::make('order.index')->with('orders', $orders);
 }
开发者ID:emrys96,项目名称:sizzle-pizza,代码行数:10,代码来源:OrderController.php

示例12: user_index

 public static function user_index()
 {
     return function ($request, $response) {
         if (!$request->session('admin')) {
             $user_id = $request->session('id');
             $orders = Order::findByUser($user_id);
             if (!$user_id) {
                 $response->code(403);
             } else {
                 if ($orders) {
                     $response->json($orders->as_array());
                 } else {
                     $response->json(array());
                 }
             }
         } else {
             $order = Order::all();
             $response->json($order->as_array());
         }
     };
 }
开发者ID:samdubey,项目名称:ads2,代码行数:21,代码来源:orderctrl.php

示例13: index

 /**
  * Display a listing of orders
  *
  * @return Response
  */
 public function index()
 {
     $orders = Order::all();
     return View::make('orders.index', compact('orders'));
 }
开发者ID:vnzacky,项目名称:exp_services,代码行数:10,代码来源:OrdersController.php

示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     return Response::json($this->order->all());
 }
开发者ID:bluecipherz,项目名称:gl-ct,代码行数:9,代码来源:OrderController.php

示例15: getOrder

 public function getOrder()
 {
     $orders = Order::all();
     return View::make('admin.order')->with('orders', $orders);
 }
开发者ID:bernardowiredu,项目名称:unlocking-site,代码行数:5,代码来源:OrderController.php


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