Thanks for posting your query.
You are having urine infection & should continue antibiotics as prescribed by your gynecologist.
There are many causes of infertility
along with pelvic inflammatory disease
like an ovulation, tubal blockage & uterine pathology like congenital malformed uterus.
Male factor is equally responsible for infertility like oligospermia
So consult your gynaecologist both of you to rule out cause of infertility.