本文整理汇总了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('/');
}
}
示例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('/');
}
}
示例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('/');
}
}
示例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('/');
}
}
示例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);
}
}
示例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('/');
}
}