當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OrderItem::where方法代碼示例

本文整理匯總了PHP中OrderItem::where方法的典型用法代碼示例。如果您正苦於以下問題:PHP OrderItem::where方法的具體用法?PHP OrderItem::where怎麽用?PHP OrderItem::where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OrderItem的用法示例。


在下文中一共展示了OrderItem::where方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: order

 function order($id)
 {
     $userId = Session::get('user_id');
     if (!isset($userId)) {
         return Redirect::to('/');
     }
     $order = Order::find($id);
     if (isset($order)) {
         $orderItems = OrderItem::where('order_id', $order->id)->get();
         return View::make('user.order')->with('order', $order)->with('orderItems', $orderItems);
     } else {
         return Redirect::to('/');
     }
 }
開發者ID:ashutoshpandey,項目名稱:course,代碼行數:14,代碼來源:UserController.php

示例2: adminInvoice

 public function adminInvoice($id)
 {
     if (isset($id)) {
         $order = Order::find($id);
         if (isset($order)) {
             //  Session::put('order_id', $id);
             $orderItems = OrderItem::where('order_id', $order->id)->get();
             $couriers = Courier::where('status', 'active')->get();
             $pdf = PDF::loadView('pdf.adminInvoice', ['order' => $order, 'orderItems' => $orderItems, 'couriers' => $couriers]);
             //                return $pdf->download('invoice.pdf');
             return $pdf->stream();
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
開發者ID:ashutoshpandey,項目名稱:course,代碼行數:18,代碼來源:PDFConrtoller.php

示例3: saveInvoice

 public static function saveInvoice($id)
 {
     if (isset($id)) {
         $order = Order::find($id);
         if (isset($order)) {
             //  Session::put('order_id', $id);
             $orderItems = OrderItem::where('order_id', $order->id)->get();
             $couriers = Courier::where('status', 'active')->get();
             $pdf = PDF::loadView('pdf.adminInvoice', ['order' => $order, 'orderItems' => $orderItems, 'couriers' => $couriers]);
             $output = $pdf->output();
             $file_to_save = './public/uploads/pdf/order_' . $order->id . '.pdf';
             file_put_contents($file_to_save, $output);
             return true;
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
開發者ID:ashutoshpandey,項目名稱:course,代碼行數:20,代碼來源:PdfHelper.php

示例4: transactionSuccess

 public function transactionSuccess()
 {
     $transactionId = Session::get('transactionId');
     if ($transactionId) {
         $status = Input::get('status');
         if ($status == 'success') {
             $payment_mode = Input::get('mode');
             $gateway_payment_id = Input::get('mihpayid');
             $net_amount_debit = Input::get('net_amount_debit');
             $order = Order::where('transaction_id', $transactionId)->first();
             if (isset($order)) {
                 $order->payment_mode = $payment_mode;
                 $order->gateway_payment_id = $gateway_payment_id;
                 $order->net_amount_debit = $net_amount_debit;
                 $order->save();
                 $order_id = $order->id;
                 $mail = SendMailController::userInvoiceMail($order_id);
                 if ($mail) {
                     $order = Order::find($order_id);
                     $orderItems = OrderItem::where('order_id', $order_id)->get();
                     return View::make('checkout.transaction-success')->with('order', $order)->with('orderItems', $orderItems);
                 }
             } else {
                 return Redirect::to('/transaction-failure');
             }
         } else {
             return Redirect::to('/transaction-failure');
         }
     } else {
         return Redirect::to('/');
     }
 }
開發者ID:ashutoshpandey,項目名稱:course,代碼行數:32,代碼來源:CheckoutController.php

示例5: orders

 public function orders()
 {
     $user_id = Session::get('user_id');
     if (is_null($user_id)) {
         return Redirect::to('/');
     }
     $orders = Order::where('user_id', $user_id)->get();
     $orderItems = array();
     if (isset($orders) && count($orders) > 0) {
         foreach ($orders as $order) {
             $orderItems[] = OrderItem::where('order_id', $order->id)->get();
         }
     }
     if (isset($orderItems) && count($orderItems) > 0) {
         return View::make('order.list')->with('found', true)->with('orders', $orders)->with('orderItems', $orderItems);
     } else {
         return View::make('order.list')->with('found', false);
     }
 }
開發者ID:ashutoshpandey,項目名稱:course,代碼行數:19,代碼來源:OrderController.php

示例6: viewOrder

 public function viewOrder($id)
 {
     $adminId = Session::get('admin_id');
     if (!isset($adminId)) {
         return Redirect::to('/');
     }
     if (isset($id)) {
         $order = Order::find($id);
         if (isset($order)) {
             Session::put('order_id', $id);
             $orderItems = OrderItem::where('order_id', $order->id)->get();
             $couriers = Courier::where('status', 'active')->get();
             return View::make('admin.view-order')->with('order', $order)->with('orderItems', $orderItems)->with('couriers', $couriers);
         } else {
             return Redirect::to('/');
         }
     } else {
         return Redirect::to('/');
     }
 }
開發者ID:ashutoshpandey,項目名稱:course,代碼行數:20,代碼來源:AdminController.php


注:本文中的OrderItem::where方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。