A York hospital trust has urged visitors to “stay away” if they are feeling unwell to avoid passing bugs to hospital patients this winter.