Marriage and infidelity

I am having some really challenging issues in my marriage. We have been together for around 13 years. About 8 years into our relationship, I started an affair. The physical aspect was on and off for about 2 years, but the emotional side went on for 4, and ended when my husband found out. Obviously the fact that I had this separate relationship is evidence that I was not managing my mind at all during that time. A lot has changed for me since then. It’s been over a year since my affair ended, but my husband can’t or won’t get over it. We have stayed together only because of our 3 young children. My goal is to live in harmony as a family with our kids, because in our case a divorce would mean my husband moving back to his home country and rarely seeing the children. But he often treats me badly and tells me that he doesn’t want to be with me, calls me names, ignores me, etc. Other times things are ok and he acts more loving. It’s a roller coaster. I’m trying to fit all of this into the model but I’m having a hard time. I’ve heard on the podcast that leaving a marriage because you want to feel better isn’t really the solution; one should leave a marriage if they can first be happy in it and still decide they want to leave. I guess one of my main issues is how to figure out, accept or justify “letting” my husband leave his precious daughters when I know/think/feel it would devastate them. Part of me wants to sacrifice my own happiness for the sake of my girls and stay married, at least until they are older. Part of me thinks this is crazy. And of course I’m scared of how to be a single mom since I have a demanding career with erratic hours. I’m scared at the thought of losing my partner, who has supported me in a lot of ways over some difficult years when I was working towards my medical degree, even though I haven’t been happy with him in some ways for a long time. I also feel sad for him – how could he leave our daughters and be ok with that?? Thanks for your help with this.