An On-demand Photonic Ising Machine with Simplified Hamiltonian Calculation by Phase-encoding and Intensity Detection