Boosting photocatalytic activity through tuning electron spin states and external magnetic fields