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


PHP Order::with方法代码示例

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


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

示例1: getOrder

 /**
  * Displays a single order.
  */
 public function getOrder($id)
 {
     // Get the order.
     $order = Order::with('order_lines.product', 'user', 'address')->first();
     // Render the view.
     return View::make('admin.order', ['order' => $order]);
 }
开发者ID:Fash1,项目名称:Fash1,代码行数:10,代码来源:AdminController.php

示例2: index

 public function index()
 {
     if (Auth::user()->check()) {
         $query = Order::with(["user", "orderDetails", "orderDetails.image"]);
         $query->where("user_id", Auth::user()->get()->id);
         return $query->get();
     }
     return Redirect::route('account-sign-in');
 }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:9,代码来源:OrderController.php

示例3: indexAction

 public function indexAction()
 {
     $query = Order::with(["account", "orderItems", "orderItems.product", "orderItems.product.category"]);
     $account = Input::get("account");
     if ($account) {
         $query->where("account_id", $account);
     }
     return $query->get();
 }
开发者ID:gitter-badger,项目名称:tutorial-laravel-4-e-commerce,代码行数:9,代码来源:OrderController.php

示例4: remembLog

 public function remembLog()
 {
     if (!Session::has('username')) {
         return Redirect::to('/');
     } else {
         $empId = DB::table('tblLogin')->join('tblEmployees', function ($join) {
             $join->on('tblLogin.strLoginEmpID', '=', 'tblEmployees.strEmpID');
             // ->where('tblLogin.strUsername','=',Session::get('username'));
         })->get();
         $orders = Order::with('supplier', 'employee', 'products', 'notes')->get();
         $index = DB::table('tblInventory')->join('tblProducts', function ($join) {
             $join->on('tblInventory.strProdID', '=', 'tblProducts.strProdID')->where('tblInventory.intAvailQty', '<=', '10');
         })->get();
         return View::make('index')->with('index', $index)->with('empId', $empId)->with('orders', $orders);
     }
 }
开发者ID:ExperimentalGroup,项目名称:inventoryfinal,代码行数:16,代码来源:loginController.php

示例5: get_index

 function get_index()
 {
     $vars = array('isManager' => $this->can('manager'), 'can' => array(), 'user' => $this->user(false));
     $query = Order::with('manager')->name('o');
     Event::fire('order.list.query', array($query, $this, &$vars['can']));
     $rows = S::keys($query->get(), '?->id');
     if ($rows) {
         foreach ($rows as &$order) {
             $order->current = false;
         }
         $current = static::detectCurrentOrder();
         $current and $rows[$current->id]->current = true;
         Event::fire('order.list.populate', array(&$rows, $this, &$vars));
     }
     $vars['rows'] = func('to_array', $rows);
     Event::fire('order.list.vars', array(&$vars, $this));
     return $vars;
 }
开发者ID:SerdarSanri,项目名称:VaneMart,代码行数:18,代码来源:Order.php

示例6: editOrder

 public function editOrder($orderId)
 {
     try {
         $order = Order::with('images')->findorFail($orderId);
     } catch (Illuminate\Database\Eloquent\ModelNotFoundException $e) {
         return App::abort(404);
     }
     $order = $order->toArray();
     $order['images'] = reset($order['images']);
     $this->layout->title = 'Edit Order';
     $this->layout->content = View::make('admin.orders-one')->with(['order' => $order]);
 }
开发者ID:nguyendaivu,项目名称:imagestock,代码行数:12,代码来源:OrdersController.php

示例7: Session

<?php

require_once '../classes/session.php';
require_once '../classes/functions.php';
require __DIR__ . '/../vendor/autoload.php';
require '../config.php';
require '../classes/boot.php';
require_once '../classes/Item.php';
require_once '../classes/Restaurant.php';
require_once '../classes/User.php';
require_once '../classes/Order.php';
$session = new Session();
$session->forceLogin('../index.php');
$user = User::find($session->getUsername());
$orders = Order::with('restaurant')->where('userid', $user->id)->orderBy('id', 'desc')->get();
getTemplate(1, 'header', []);
?>
<body>
<?php 
include './includes/nav.php';
?>

<div class="orderscontainer" ng-controller="PageController">
  <div class="container">
    <div class="row">
      <div class="col s12 m12">
        <h3>Orders</h3>
        <ul class="collection">
          <?php 
foreach ($orders as $key => $value) {
    ?>
开发者ID:helloworldprojects,项目名称:FoodWeb,代码行数:31,代码来源:orders.php

示例8: edit_get

 public function edit_get($id)
 {
     $this->_data['data'] = Order::with("user", "menu")->where("order_id", $id)->first();
     return View::make("admin.content.order.edit", $this->_data)->with("titlePage", "Edit Order")->with("titleTable", "Sửa yêu cầu tại nhà hàng");
 }
开发者ID:quanit94,项目名称:ABCKitchen,代码行数:5,代码来源:OrderController.php

示例9: _sendDeliveryStoredInfo

 protected function _sendDeliveryStoredInfo($id)
 {
     $order = \Order::with('orderSchedule', 'orderStuff', 'user')->find($id);
     $order['order_payment'] = GetLastInvoiceOrder($id);
     $to = ['code' => $order['order_payment']['code'], 'email' => $order['user']['email'], 'name' => $order['user']['fullname']];
     $data = ['order' => $order];
     \Mail::send('emails.order-stored-by-driver', $data, function ($message) use($to) {
         $message->to($to['email'], $to['name'])->subject('[ThankSpace] Order #' . $to['code'] . ' sudah kami tangani');
     });
 }
开发者ID:rizalafani,项目名称:thankspace,代码行数:10,代码来源:OrderRepo.php

示例10: order

 public function order()
 {
     $orders = Order::with('supplier', 'employee', 'products', 'notes')->get();
     return View::make('order.order')->with('orders', $orders);
 }
开发者ID:ExperimentalGroup,项目名称:inventoryfinal,代码行数:5,代码来源:HomeController.php

示例11: getStorageDetail

 /**
  * Get order detail
  *
  * @param  integer $id
  * @return \Illuminate\Database\Eloquent\Model
  */
 public function getStorageDetail($id)
 {
     $data = \Order::with('orderSchedule', 'orderStuff')->find($id);
     $data['order_payment'] = GetLastInvoiceOrder($id);
     return $data;
 }
开发者ID:rizalafani,项目名称:thankspace,代码行数:12,代码来源:UserRepo.php

示例12: getIndex

 public function getIndex()
 {
     $member_id = Auth::user()->id;
     $orders = Order::with('orderItems')->where('member_id', '=', $member_id)->get();
     return View::make('order')->with('orders', $orders);
 }
开发者ID:ngeshlew,项目名称:laravel-e-commerce-book-store,代码行数:6,代码来源:OrderController.php

示例13: show

 /**
  * Display the specified product.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     $orders = Order::with(["customer.orders.invoices", "customer.orders.orderItems", "customer.customerType", "invoices", "employee", "business", "orderItems", "orderItems.product.unit"])->whereId($id)->get();
     foreach ($orders as $order) {
         if ($order->customer->customerType->customer_type == "Chủ cửa hàng") {
             if ($order->business->type == "Nhập") {
                 $orderTotal = 0;
                 foreach ($order->orderItems as $product) {
                     $raw = $product->price * $product->quantity;
                     $discountValue = $raw * $product->discount / 100;
                     $taxValue = $raw * $product->tax / 100;
                     $total = $raw + $taxValue - $discountValue;
                     array_add($product, 'total', $total);
                     $orderTotal += $total;
                 }
                 array_add($order, 'order_total', $orderTotal);
             }
             if ($order->business->type == "Xuất") {
                 $orderTotal = 0;
                 foreach ($order->orderItems as $product) {
                     $raw = $product->price * $product->quantity;
                     $discountValue = $raw * $product->discount / 100;
                     $taxValue = $raw * $product->tax / 100;
                     $total = $raw + $taxValue - $discountValue;
                     array_add($product, 'total', $total);
                     $orderTotal += $total;
                 }
                 array_add($order, 'order_total', $orderTotal);
             }
             if ($order->business->name == "Thu góp vốn") {
                 $orderTotal = $order->price;
                 array_add($order, 'order_total', $orderTotal);
             }
             if ($order->business->type == "Thu" || $order->business->type == "Chi") {
                 $orderTotal = $order->price;
                 array_add($order, 'order_total', $orderTotal);
             }
             $paid = 0;
             foreach ($order->invoices as $invoice) {
                 if ($order->business->type == "Xuất") {
                     if ($invoice->business->type == "Thu") {
                         $paid += $invoice->price;
                     }
                 }
                 if ($invoice->business->type == "Chi") {
                     $paid += $invoice->price;
                 }
             }
             array_add($order, 'paid', $paid);
         }
         if ($order->customer->customerType->customer_type == "Nhà cung cấp") {
             if ($order->business->type == "Nhập") {
                 $orderTotal = 0;
                 foreach ($order->orderItems as $product) {
                     $raw = $product->price * $product->quantity;
                     $discountValue = $raw * $product->discount / 100;
                     $taxValue = $raw * $product->tax / 100;
                     $total = $raw + $taxValue - $discountValue;
                     array_add($product, 'total', $total);
                     $orderTotal += $total;
                 }
                 array_add($order, 'order_total', $orderTotal);
             }
             if ($order->business->type == "Xuất") {
                 $orderTotal = 0;
                 foreach ($order->orderItems as $product) {
                     $raw = $product->price * $product->quantity;
                     $discountValue = $raw * $product->discount / 100;
                     $taxValue = $raw * $product->tax / 100;
                     $total = $raw + $taxValue - $discountValue;
                     array_add($product, 'total', $total);
                     $orderTotal += $total;
                 }
                 array_add($order, 'order_total', $orderTotal);
             }
             if ($order->business->type == "Thu" || $order->business->type == "Chi") {
                 $orderTotal = $order->price;
                 array_add($order, 'order_total', $orderTotal);
             }
             $paid = 0;
             foreach ($order->invoices as $invoice) {
                 if ($order->business->type == "Xuất") {
                     if ($invoice->business->type == "Thu") {
                         $paid += $invoice->price;
                     }
                 }
                 if ($invoice->business->type == "Chi") {
                     $paid += $invoice->price;
                 }
             }
             array_add($order, 'paid', $paid);
         }
         if ($order->customer->customerType->customer_type == "Khách mua lẻ") {
             $oldDebt = 0;
//.........这里部分代码省略.........
开发者ID:jimmyhien,项目名称:dailyhuuhoc,代码行数:101,代码来源:OrdersController.php

示例14: payment

 public function payment()
 {
     $orderId = Session::get('order_id');
     if (isset($orderId)) {
         $order = Order::with('orderItems')->find($orderId);
         if (isset($order)) {
             $product_array = array();
             foreach ($order->orderItems as $orderItem) {
                 $product = Product::find($orderItem->product_id);
                 if (isset($product)) {
                     $product_array[] = array("name" => $product->name, "value" => $product->discounted_price, "description" => "");
                 }
             }
             $transactionId = microtime(true);
             Session::put('transactionId', $transactionId);
             $order->transaction_id = $transactionId;
             $order->save();
             return View::make('checkout.payment')->with('order', $order)->with('product_json', json_encode($product_array))->with('transactionId', $transactionId);
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
开发者ID:ashutoshpandey,项目名称:course,代码行数:25,代码来源:CheckoutController.php

示例15: listOrders

 public function listOrders($status, $page)
 {
     $adminId = Session::get('admin_id');
     if (!isset($adminId)) {
         return json_encode(array('message' => 'not logged'));
     }
     if (isset($status)) {
         $orders = Order::with('user')->where('status', '=', $status)->get();
         if (isset($orders) && count($orders) > 0) {
             return json_encode(array('message' => 'found', 'orders' => $orders->toArray()));
         } else {
             return json_encode(array('message' => 'empty'));
         }
     } else {
         return json_encode(array('message' => 'invalid'));
     }
 }
开发者ID:ashutoshpandey,项目名称:course,代码行数:17,代码来源:AdminController.php


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