RaccoonSpike
0p
1 comments posted · 0 followers · following 0
8 years ago @ За чистый и ... - Работа с фун... · 0 replies · +1 points
Огромное спасибо Вы только что спасили меня вот от такого монстра:
SELECT t1.id as ID, t1.post_name as URL, t1.post_title as NAME, t2.meta_value as BEGIN, t1.post_content as DETAIL, t3.meta_value as END, t4.meta_value as LOGO, t4.meta_value as CNT_ACTIONS, t4.meta_value as COST_ACTION, t7.meta_value as LANG, t8.meta_value as VENUE
FROM wp_posts t1
LEFT JOIN wp_postmeta t2 ON t1.id = t2.post_id AND t2.meta_key = '_EventStartDate'
LEFT JOIN wp_postmeta t3 ON t1.id = t3.post_id AND t3.meta_key = '_EventEndDate'
LEFT JOIN wp_postmeta t4 ON t1.id = t4.post_id AND t4.meta_key = '_thumbnail_id'
LEFT JOIN wp_postmeta t5 ON t1.id = t5.post_id AND t5.meta_key = 'cnt_actions'
LEFT JOIN wp_postmeta t6 ON t1.id = t6.post_id AND t6.meta_key = '_EventCost'
LEFT JOIN wp_postmeta t7 ON t1.id = t7.post_id AND t7.meta_key = 'language'
LEFT JOIN wp_postmeta t8 ON t1.id = t8.post_id AND t8.meta_key = '_EventVenueID'
WHERE t1.post_status = 'publish'
AND t1.post_type='tribe_events'
SELECT t1.id as ID, t1.post_name as URL, t1.post_title as NAME, t2.meta_value as BEGIN, t1.post_content as DETAIL, t3.meta_value as END, t4.meta_value as LOGO, t4.meta_value as CNT_ACTIONS, t4.meta_value as COST_ACTION, t7.meta_value as LANG, t8.meta_value as VENUE
FROM wp_posts t1
LEFT JOIN wp_postmeta t2 ON t1.id = t2.post_id AND t2.meta_key = '_EventStartDate'
LEFT JOIN wp_postmeta t3 ON t1.id = t3.post_id AND t3.meta_key = '_EventEndDate'
LEFT JOIN wp_postmeta t4 ON t1.id = t4.post_id AND t4.meta_key = '_thumbnail_id'
LEFT JOIN wp_postmeta t5 ON t1.id = t5.post_id AND t5.meta_key = 'cnt_actions'
LEFT JOIN wp_postmeta t6 ON t1.id = t6.post_id AND t6.meta_key = '_EventCost'
LEFT JOIN wp_postmeta t7 ON t1.id = t7.post_id AND t7.meta_key = 'language'
LEFT JOIN wp_postmeta t8 ON t1.id = t8.post_id AND t8.meta_key = '_EventVenueID'
WHERE t1.post_status = 'publish'
AND t1.post_type='tribe_events'