Effect of reputation-based heterogeneous investment on cooperation in spatial public goods game