Your description is not very specific of conditions. Do they auto-lock after put in drive , but don't unlock when put in park? Or do the remote(s) for the keyless entry lock only but don't unlock? Are ALL locks and latches functional Including tailgate and hood?
Stuck switch? If it works on that model, try pulling the fuse for the door locks , leave it out for a minute and then re-install it. MAYBE that will 'reset' the system? Will they act up even if one of the doors is open?