问题 In wooCommerce, I am using the following code to create programmatically a single coupon: $coupon_amount = '20'; $code_value = wp_generate_password( 15, false ); $coupon_code = $code_value; $expiry_date = date('Y-m-d', strtotime('+140 days')); function create_coupon_codes($coupon_amount, $coupon_code, $expiry_date, $email_address) { global $wpdb; $sql = $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type = 'shop_coupon' AND post_status = 'publish' ORDER BY post