Guest User

Untitled

a guest
Jun 3rd, 2020
26
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. SELECT sql_calc_found_rows
  2. u.id,
  3. u.user_login,
  4. u.user_email,
  5. u.user_nicename,
  6. u.display_name,
  7. Unix_timestamp(u.user_registered) AS joindate,
  8. mu.membership_id,
  9. mu.initial_payment,
  10. mu.billing_amount,
  11. mu.cycle_period,
  12. mu.cycle_number,
  13. mu.billing_limit,
  14. mu.trial_amount,
  15. mu.trial_limit,
  16. Unix_timestamp(mu.startdate) AS startdate,
  17. Unix_timestamp(mu.enddate) AS enddate,
  18. m.NAME AS membership,
  19. umf.meta_value AS first_name,
  20. uml.meta_value AS last_name
  21. FROM wp_users u
  22. LEFT JOIN wp_usermeta umh
  23. ON umh.meta_key = 'pmpromd_hide_directory'
  24. AND u.id = umh.user_id
  25. LEFT JOIN wp_usermeta umf
  26. ON umf.meta_key = 'first_name'
  27. AND u.id = umf.user_id
  28. LEFT JOIN wp_usermeta uml
  29. ON uml.meta_key = 'last_name'
  30. AND u.id = uml.user_id
  31. LEFT JOIN wp_usermeta um
  32. ON u.id = um.user_id
  33. LEFT JOIN wp_pmpro_memberships_users mu
  34. ON u.id = mu.user_id
  35. LEFT JOIN wp_pmpro_membership_levels m
  36. ON mu.membership_id = m.id
  37. WHERE mu.status = 'active'
  38. AND (
  39. umh.meta_value IS NULL
  40. OR umh.meta_value <> '1')
  41. AND mu.membership_id > 0
  42. GROUP BY u.id
  43. ORDER BY u.display_name ASC
  44. LIMIT 0, 12
RAW Paste Data