You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LEFT JOIN $wpdb->postmeta AS requires_update_field ON ($wpdb->posts.ID = requires_update_field.post_id AND requires_update_field.meta_key = 'requires_update' )
112
114
LEFT JOIN $wpdb->postmeta AS group_status_field ON ( $wpdb->posts.ID = group_status_field.post_id AND group_status_field.meta_key = 'group_status' )
113
115
WHERE ( requires_update_field.meta_value = '' OR requires_update_field.meta_value = '0' OR requires_update_field.meta_value IS NULL )
114
116
AND group_status_field.meta_value = %s
115
-
AND %d >= ( SELECT MAX( hist_time ) FROM $wpdb->dt_activity_log WHERE object_id = $wpdb->posts.ID and user_id != 0 && action = 'field_update' )
116
-
AND NOT EXISTS ( SELECT 1 FROM $wpdb->comments WHERE comment_post_ID = $wpdb->posts.ID AND user_id != 0 )
117
+
AND %d >= GREATEST(
118
+
COALESCE(( SELECT MAX( hist_time ) FROM $wpdb->dt_activity_log WHERE object_id = $wpdb->posts.ID AND user_id != 0 AND action = 'field_update' ), 0),
119
+
COALESCE(( SELECT MAX( UNIX_TIMESTAMP( comment_date ) ) FROM $wpdb->comments WHERE comment_post_ID = $wpdb->posts.ID AND user_id != 0 ), 0)
120
+
)
117
121
AND $wpdb->posts.post_type = 'groups' AND $wpdb->posts.post_status = 'publish'
118
122
GROUP BY $wpdb->posts.ID ORDER BY $wpdb->posts.post_date DESC LIMIT 0, 50",
0 commit comments