Fixed query issue for order history in controller and view