A recursive method for calculating the total number of spanning trees and its applications in self-similar small-world scale-free network models