Problem adding ‘has-children’ class to wp_nav_menu

You can’t shouldn’t hardcode table names into queries, especially with multisite. Swap $wpdb->postmeta for wp_postmeta and it’ll likely work.

edit- technically you can, edited for clarity.