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