The pub chain Wetherspoons has reported solid sales but falling margins.