Measurement of branching fractions for D meson decaying into ϕ meson and a pseudoscalar meson