Cadillac sts 2006 problems

I have a cadillac STS 2006. My car all week has been giving me trouble recognizing my key ( it has that keyless entery)and i have to put my key right up to the start button for the car to start. Two days ago my car would not start so i got a jump start car started right up for the next two day just fine until this morning. The car again would not start so I got a jump start and took it to oriley’s to have the battery checked and the alternator. the battery was at zero and the alternator was running a little bit low but not low enough to have to be replaced. i took the car home and did not purchase the new battery just yet. I did some stuff around the house and than went back to the car to see if it would start. it started right up. I did this several times with time in betweeen each try. Car is not giving me any problems now. I am feeling like the problem is not my battery but something electrical. What do you think could be the problem? 2006 V6 cadillac STS

alternator was running a little bit low

You need to be more specific to get a meaningful answer.

What are the DC and AC battery voltages with the engine at fast idle and all accessories off?

Should be ~14VDC and less then 1VAC.

There could be a “parasitic load” draining the battery,Any decent auto-electric shop will be able to cure this in a hurry…