In this paper, the impact of corporate social responsibility (CSR) goodwill on market demand was considered. For the cases of Nash non-cooperative game, manufacturer-led Stackelberg game, retailer-led Stackelberg game, and cooperative game, differential game models were constructed and the optimal level of CSR effort for the manufacturer and the retailer, the optimal trajectory of CSR goodwill, and the optimal value of profit was studied. Also, the correctness of the theoretical derivations was verified through numerical simulations, and some important results were obtained. First, the optimal subsidy rate of CSR cost is related to marginal profit and is unaffected by other factors. Second, compared with the Nash non-cooperative game, in the case of Stackelberg game, the leader subsidizes the CSR cost of the follower when the marginal profit of the leader is greater than half the marginal profit of the follower. Moreover, the optimal level of CSR effort for the leader remains unchanged, while the optimal level of CSR effort for the follower increases, so the profits improve for both the manufacturer and the retailer. Third, compared to the Stackelberg game, in the case of cooperative games, the optimal level of CSR effort improves for both the manufacturer and the retailer, and the profit also increases for the supply chain system.