求翻译,求分析:they spent a lot of time negotiating for a pay rise, only to be fired.

问题描述:

求翻译,求分析:they spent a lot of time negotiating for a pay rise, only to be fired.
尤其后面的only to be fired.在句子中充当什么成分?
这句话意思是什么?

他们花了许多时间去交涉涨工资,结果却被开除了,only to be fired 做结果状语