function panelUsuario() { $cntCarrito = Carrito::getItems(); $usuario = Auth::user(); $pedidos = \App\Pedido::where('idCliente', $usuario->id)->get(); return view('cliente.cliente_pedidos', compact('pedidos', 'cntCarrito')); }
public function pedidosCajalaravel($id) { $pedido = Pedido::where('id', $id)->where('activo', 1)->with('detallespedidostodos')->first(); $html = ""; $html2 = ""; if ($pedido->detallespedidostodos) { foreach ($pedido->detallespedidostodos as $detalle) { $html .= '<div class="media">' . '<div class="media-left">' . '<a href="#">' . '<img class="media-object" src="' . $detalle->producto->imagen_principal . '" class="thumb" height="75" width="75" alt="a picture">' . '</a>' . '</div>' . '<div class="media-body">' . '<ul class="list-group">' . '<li class="list-group-item">' . '<font color="black"><strong><td>Nombre:</td></strong></font>' . '<td> ' . $detalle->producto->nombre . ' </td>' . '</li>' . '<li class="list-group-item">' . '<font color="black"><strong><td>Descripción:</td></strong></font>' . '<td> ' . $detalle->producto->detalles . ' </td>' . '</li>' . '<li class="list-group-item">' . '<font color="black"><strong><td>Cantidad:</td></strong></font>' . '<font color="red"><td>' . $detalle->cantidad . ' </td></font>' . '<font color="black"><strong><td>Precio:</td></strong></font>' . '<font color="red"><td>$' . $detalle->precio . ' </td></font>' . '<font color="black"><strong><td>Subtotal:</td></strong></font>' . '<font color="red"><td>$' . $detalle->subtotal . ' </td></font>' . '</li>' . '<li class="list-group-item">' . '<font color="black"><strong><td>Observaciones:</td></strong></font>' . '<td> ' . $detalle->observaciones . ' </td>' . '</li>' . '</ul>' . '</div>' . '</div>'; } } return \Response::json(['error' => 'false', 'msg' => $html, 'status' => '200'], 200); }
public static function pedidosPendientes() { $pendientes = Pedido::where('completado', 0)->count(); return $pendientes; }
public function historialPedidos() { $cntPedidos = Pedido::pedidosPendientes(); $pedidos = \App\Pedido::where('completado', 'true')->get(); return view('empleado.historial_pedidos', compact('pedidos', 'cntPedidos')); }