Skip to content

Instantly share code, notes, and snippets.

@codearachnid
Created February 6, 2020 17:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codearachnid/882503dbdc3c56e0d2b942e2d6f71a3b to your computer and use it in GitHub Desktop.
Save codearachnid/882503dbdc3c56e0d2b942e2d6f71a3b to your computer and use it in GitHub Desktop.
Sabai Report Directory Export Report (Camp Finder)
SELECT t1.entity_id, t2.post_id, t2.post_title, t1.value, t3.address, t3.street, t3.city, t3.state, t3.zip, t4.phone, t4.mobile, t4.fax, t4.email, t4.website, DATE_FORMAT(FROM_UNIXTIME(t5.edited_at), "%Y-%m-%d")
FROM wp_sabai_entity_field_content_body as t1
LEFT JOIN wp_sabai_content_post as t2
ON t1.entity_id = t2.post_id
LEFT JOIN wp_sabai_entity_field_directory_location as t3
ON t1.entity_id = t3.entity_id
LEFT JOIN wp_sabai_entity_field_directory_contact as t4
ON t1.entity_id = t4.entity_id
LEFT JOIN wp_sabai_entity_field_content_activity as t5
ON t1.entity_id = t5.entity_id
WHERE t2.post_entity_bundle_name = 'campfinder_listing'
AND t2.post_status = 'published'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment