Bar effect on gas-phase abundance gradients – II. Luminosity-dependent flattening