I'm looking for an equivalent to the following proverb which states, "The cactus is only visited when he has prickly pears." It means something like "He is only visited when he has money." I can't think of any in English to be equal.
Proverbs 14:20 reads
The poor are shunned even by their neighbors, but the rich have many friends.
But this is far more transparent, and one version even helpfully [!] puts 'friends' in scare quotes. I think I'll start using the translation of the Mexican proverb.
In the American Blues tradition, the expression
Nobody knows you when you['re] down and out
has been a familiar refrain for almost a hundred years. On YouTube, you can hear Bessie Smith's 1929 version of the blues song of that name. The sense of the expression is, of course, that everyone is your friend—and is happy to help you spend your money—when you're rich, but no one wants to associate with you if they can't derive any material benefit from it.
Consider, A friend in need is a friend indeed
Almost always it is the origin of a phrase or saying that requires the most research, the meaning being well understood. This phrase is interesting because there are various interpretations of its meaning.
There is some debate about the meaning of this expression. Firstly, is it 'a friend in need is a friend indeed' or 'a friend in need is a friend in deed'? Secondly, is it 'a friend (when you are) in need' or 'a friend (who is) in need'? If the former, then the phrase means: 'someone who helps you when you are in need is a true friend'. If the latter, it is 'someone who needs your help becomes especially friendly in order to obtain it'.
Al nopal solo lo buscan cuando tiene tunas
lit. "They only look for the cactus when it has prickly pears"
Means, they only look for you when they need your help
A fair-weather friend is someone who is only around for the good times. That's not exactly what you're looking for, but it is related.