sql = INSERT INTO wp_uam_accessgroup_to_object (object_id, general_object_type, object_type, group_id, group_type) SELECT wp_wc_customer_lookup.user_id, '_user_', '_user_', wp_uam_accessgroups.id, 'UserGroup' FROM wp_wc_order_product_lookup JOIN wp_wc_customer_lookup ON wp_wc_customer_lookup.customer_id = wp_wc_order_product_lookup.customer_id JOIN wp_users ON wp_users.id = wp_wc_customer_lookup.user_id JOIN wp_posts ON wp_posts.id = wp_wc_order_product_lookup.product_id JOIN wp_term_relationships ON wp_term_relationships.object_id = wp_posts.id JOIN wp_term_taxonomy ON wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id JOIN wp_terms ON wp_terms.term_id = wp_term_taxonomy.term_id JOIN wp_uam_accessgroups ON wp_terms.name = wp_uam_accessgroups.groupname LEFT JOIN wp_uam_accessgroup_to_object ON wp_wc_customer_lookup.user_id = wp_uam_accessgroup_to_object.object_id AND general_object_type = '_user_' AND object_type = '_user_' AND group_type = 'UserGroup' AND wp_uam_accessgroups.id = wp_uam_accessgroup_to_object.group_id WHERE taxonomy = 'product_tag' AND order_id = 638 AND wp_uam_accessgroup_to_object.object_id IS NULL
rc = 0
rc = 1
rc = 0

One Comment

  1. Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

Leave a Comment

Your email address will not be published. Required fields are marked *