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 1612537200 AND 1613314800 AND exdate IS NULL) OR exdate BETWEEN 1612537200 AND 1613314800) AND IF(exdate,exdate,edate) BETWEEN 1612537200 AND 1613314800 AND status=0 ORDER BY edate