Magnetic fields are important physics in stellar evolutionary theory, which seriously affects the stellar structure and evolutionary statues. The small-scale magnetic fields in the photosphere are ubiquitous, and float on the stellar surface, which usually couple with the acoustic waves, affecting the propagation of the acoustic waves. Considering the effect of the magnetic fields in the stellar photosphere on the oscillation frequencies, we calculate the asteroseismology for solar-like star KIC 11295426 and KIC 10963065. We obtain the stellar fundamental parameters, especially the strength of small-scale magnetic fields in the stellar photosphere. We find that the small-scale magnetic fields in the stellar photosphere may obviously improve the agreement between the observations and the theoretical models for two stars. The magnetic strength for KIC 11295426 and KIC 10963065 from asteroseismology are in agreement with the stellar period-activity relation.