SELECT title,catname,e.eid,exid,IF(exdate,exdate,edate) edate,summary, IF(x.reserved,x.reserved,o.reserved)/IF(expersons,expersons,persons)*100, closetime FROM f1570c_eguide e LEFT JOIN f1570c_eguide_category c ON e.topicid=c.catid LEFT JOIN f1570c_eguide_opt o ON e.eid=o.eid LEFT JOIN f1570c_eguide_extent x ON e.eid=eidref WHERE ((edate BETWEEN 1533308400 AND 1534086000 AND exdate IS NULL) OR exdate BETWEEN 1533308400 AND 1534086000) AND IF(exdate,exdate,edate) BETWEEN 1533308400 AND 1534086000 AND status=0 ORDER BY edate