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


PHP Order::all方法代码示例

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


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

示例1: dashboard

 /**
  * Dashboard Details
  *
  *
  */
 public function dashboard()
 {
     $products = Product::all()->count();
     $orders = Order::all()->count();
     $users = User::all()->count();
     return view('admin.dashboard', compact('products', 'orders', 'users'));
 }
开发者ID:hafizzain,项目名称:mei-project,代码行数:12,代码来源:MeiController.php

示例2: index

 public function index()
 {
     $users = Order::all();
     $orders = Order::orderBy('id', 'desc')->paginate(5);
     //dd($orders);
     return view('admin.order.index', compact('orders', 'users'));
 }
开发者ID:kazamax,项目名称:tienda,代码行数:7,代码来源:OrderController.php

示例3: index

 public function index()
 {
     $users = User::all();
     $orders = Order::all();
     $usersTotal = count($users);
     $ordersTotal = count($orders);
     $coffee1 = DB::table('coffees')->where('id', 1)->first();
     $coffee2 = DB::table('coffees')->where('id', 2)->first();
     $coffee3 = DB::table('coffees')->where('id', 3)->first();
     $coffee4 = DB::table('coffees')->where('id', 4)->first();
     $coffee5 = DB::table('coffees')->where('id', 5)->first();
     $pastry1 = DB::table('pastries')->where('id', 1)->first();
     $pastry2 = DB::table('pastries')->where('id', 2)->first();
     $pastry3 = DB::table('pastries')->where('id', 3)->first();
     $pastry4 = DB::table('pastries')->where('id', 4)->first();
     $pastry5 = DB::table('pastries')->where('id', 5)->first();
     $sum = 0;
     foreach ($orders as $order) {
         for ($i = 1; $i < 6; $i++) {
             $total = $order->{'coffee' . $i} * ${'coffee' . $i}->price + $order->{'pastry' . $i} * ${'pastry' . $i}->price;
             $sum = $sum + $total;
         }
     }
     $profit = 0;
     foreach ($orders as $order) {
         for ($i = 1; $i < 6; $i++) {
             $sales = $order->{'coffee' . $i} * (${'coffee' . $i}->price - ${'coffee' . $i}->cost) + $order->{'pastry' . $i} * (${'pastry' . $i}->price - ${'pastry' . $i}->cost);
             $profit = $profit + $sales;
         }
     }
     $rate = round($sum / $profit * 100, 2);
     return view('admin.dashboard', compact('usersTotal', 'ordersTotal', 'sum', 'rate'));
 }
开发者ID:jakzaizzat,项目名称:KopiBean,代码行数:33,代码来源:AdminsController.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $orders = Order::all();
     return view('order.history', array('orders' => $orders));
     //     	$order = Order::find($id);
     //     	return view('order.show', array('order' => $order));
 }
开发者ID:owlein,项目名称:laundrymgt,代码行数:13,代码来源:OrderController.php

示例5: getAll

 public function getAll()
 {
     $orders = Order::all();
     $pageData = self::orderPageData('pending', 0, 1, 1, 1);
     $pageData['table'] = $orders;
     return view('panel.orders', $pageData);
 }
开发者ID:ikliko,项目名称:Maxverf,代码行数:7,代码来源:OrderController.php

示例6: postCheckout

 public function postCheckout()
 {
     $order_count = count(Order::all()) + 2;
     $order_number = "MEI-" . date('mdY') . "-" . $order_count;
     $product_ids = Session::get("pro_ids");
     $price = Session::get("price");
     $duration = Session::get("duration");
     $quantity = Input::get("quantity");
     $total_price_sum = Input::get("total-price-sum");
     $subtotal_price_sum = Input::get("subtotal-price-sum");
     foreach ($product_ids as $product_id) {
         $pro = Product::find($product_id);
         $order = new Order(array('product_id' => $product_id, 'order_number' => $order_number, 'quantity' => $quantity[$product_id], 'subtotal' => $subtotal_price_sum[$product_id], 'duration' => $duration[$product_id], 'price' => $price[$product_id]));
         $order->save();
     }
     $order_confirmed = new ConfirmOrders(array('order_number' => $order_number, 'total' => $total_price_sum, 'user_id' => Auth::user()->id));
     $order_confirmed->save();
     $order_confirmed = ConfirmOrders::find($order_confirmed->id);
     $user_order = $order_confirmed->user;
     $order_details = Order::where('order_number', $order_confirmed->order_number)->get();
     Mail::send(['html' => 'order-received'], ['order_details' => $order_details, 'order_confirmed' => $order_confirmed, 'user_order' => $user_order], function ($message) use($user_order) {
         $message->from('info@nmkelectronics.com', 'MEI - Student Rental');
         $message->to($user_order->email)->subject('MEI - Student Rental Order');
         $message->bcc(['zain@nmkelectronics.com']);
         //  $message->bcc('zain@nmkelectronics.com')->subject('MEI - Student Rental Order');
     });
     Session::forget('pro_ids');
     Session::forget('price');
     Session::forget('duration');
     return redirect('cart')->with('order_placed', 'Thank you for contacting us. We have received your enquiry and will respond to you soon. For urgent enquiries please call us on +9714 2659533.');
 }
开发者ID:hafizzain,项目名称:mei-project,代码行数:31,代码来源:OrderController.php

示例7: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $orders = Order::all();
     foreach ($orders as $order) {
         echo $order->name . " Ordered by: " . $order->customer->name . "<br/>";
     }
 }
开发者ID:sebasw9,项目名称:laravel-fun,代码行数:12,代码来源:OrderController.php

示例8: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //$customers = Customer::has('orders')->get();
     $users = User::all();
     $orders = Order::all();
     $articles = Articles::all();
     return view('admin.index', compact('users', 'orders', 'articles'));
 }
开发者ID:jeezybrick,项目名称:laravel_first,代码行数:13,代码来源:AdminController.php

示例9: index

 /**
  * Display a list of all of the user's orders.
  *
  * @param  Request  $request
  * @return Response
  */
 public function index(Request $request)
 {
     //        return view('orders.index', [
     //            'orders' => $this->orders->forUser($request->user()),
     //        ]);
     $orders = Order::all();
     return view('orders.index', ['orders' => $orders]);
 }
开发者ID:anhtt93,项目名称:BookStore,代码行数:14,代码来源:OrderController.php

示例10: orders

 public function orders()
 {
     $orders = Order::all();
     foreach ($orders as $order) {
         $customer = Customer::find($order->customer_id);
         echo "Ordered by: " . $order->customer->name . "<br />";
         echo $order->name . "<p />";
     }
 }
开发者ID:Craig115,项目名称:dev,代码行数:9,代码来源:OrderController.php

示例11: getAllOrders

 public function getAllOrders()
 {
     $orders = Order::all()->toArray();
     foreach ($orders as $order) {
         $orderProducts = Orderdetail::where(['OrderID' => $order->OrderID])->get(['ProductID'])->toArray();
         $order = array_add($order, 'products', $orderProducts);
     }
     return $orders;
 }
开发者ID:HomeFurnitures,项目名称:HomeDecoWS,代码行数:9,代码来源:OrderService.php

示例12: admin

 public function admin()
 {
     $output = array();
     $i = 0;
     $orders = Order::all();
     foreach ($orders as $order) {
         $pivots = OrderProduct::where('order_id', $order->id)->get();
         foreach ($pivots as $pivot) {
             $prod = Product::findOrFail($pivot['product_id']);
             $output[$i]['order'] = $order;
             $p = ['prod' => $prod, 'count' => $pivot['count'], 'cost_all' => (int) $pivot['count'] * (int) $prod->cost];
             $output[$i]['product'][] = $p;
         }
         $i++;
     }
     return view('admin', ['data' => $output]);
 }
开发者ID:alaphant,项目名称:kompot_test,代码行数:17,代码来源:HomeController.php

示例13: testNotificationStatus

 public function testNotificationStatus()
 {
     // Given
     $this->startSession();
     $order = new Order(['customer_name' => 'Marsellus Wallace', 'phone_number' => '+15551231234']);
     $order->save();
     $order = $order->fresh();
     $this->assertCount(1, Order::all());
     $this->assertEquals('Ready', $order->status);
     $this->assertEquals('None', $order->notification_status);
     // When
     $response = $this->call('POST', route('order.notification.status', ['id' => $order->id, 'MessageStatus' => 'sent']), ['_token' => csrf_token()]);
     // Then
     $order = $order->fresh();
     $this->assertEquals('Ready', $order->status);
     $this->assertEquals('sent', $order->notification_status);
 }
开发者ID:TwilioDevEd,项目名称:eta-notifications-laravel,代码行数:17,代码来源:OrderControllerTest.php

示例14: index

 public function index()
 {
     $orders = Order::all();
     $sales = null;
     $taxes = null;
     foreach ($orders as $order) {
         $sales = $sales + $order->total;
         $taxes = $taxes + $order->sub_total;
     }
     $taxes = $sales - $taxes;
     $temperatures = Lava::DataTable();
     $temperatures->addDateColumn('Date')->addNumberColumn('Last period')->addNumberColumn('This period')->addRow(array('2015-11-1', 4524, 3503))->addRow(array('2015-11-2', 2332, 3880))->addRow(array('2015-11-3', 4700, 2130))->addRow(array('2015-11-4', 4200, 3100))->addRow(array('2015-11-5', 4302, 3500))->addRow(array('2015-11-6', 4130, 2332))->addRow(array('2015-11-7', 4820, 3200))->addRow(array('2015-11-8', 2504, 3500))->addRow(array('2015-11-9', 4500, 3500))->addRow(array('2015-11-10', 3350, 3500))->addRow(array('2015-11-11', 3350, 3100))->addRow(array('2015-11-12', 4500, 3555))->addRow(array('2015-11-13', 4500, 3330))->addRow(array('2015-11-14', 3350, 3200))->addRow(array('2015-11-15', 4500, 3500))->addRow(array('2015-11-16', 3350, 3500))->addRow(array('2015-11-17', 4500, 4500))->addRow(array('2015-11-18', 4500, 3500));
     $linechart = Lava::LineChart('Temps')->dataTable($temperatures)->title('Sales');
     //
     ///        dd(Lava::BackgroundColor());
     $viewBag = array('permission' => \Auth::user()->permission->name, 'orders' => $orders, 'orders_active' => Order::where('trash', '=', 0)->orderBy('created_at', 'desc')->take(5)->get(), 'sales' => $sales, 'taxes' => $taxes, 'products' => Product::where('trash', '=', 0)->get(), 'products_amount' => Product::where('stock', '=', 'N')->get(), 'users' => User::where('trash', '=', 0)->get(), 'categories' => Category::where('trash', '=', 0)->get());
     return \View::make('backend.index', $viewBag);
 }
开发者ID:stijnwop,项目名称:breiShop,代码行数:18,代码来源:BackendController.php

示例15: run

 /**
  * Run the database seeds.
  */
 public function run()
 {
     $faker = Faker\Factory::create();
     $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 = $faker->numberBetween(1, 3);
                 ItemOrder::create(['order_id' => $order->id, 'product_id' => $id, 'price' => $price, 'qty' => $quantity]);
                 $used[] = $product['id'];
             }
         }
     }
 }
开发者ID:xenxa,项目名称:essensanaturaleonline,代码行数:22,代码来源:ItemOrderTableSeeder.php


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