select t1.tsaleeventid,t1.fsaleevent,t1.fbegdate,t1.fenddate,count(t2.tcustomer_receptid)  as fordercount,t1.createby,t1.createdate,t1.changedate
from tsaleevent t1
left join tcustomer_reception t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid and t1.tsaleeventid=t2.tsaleeventid and t2.ftype='ÏúÊÛ'
where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$ and t1.tsaleeventid=$tsaleeventid$
group by t1.tsaleeventid,t1.fsaleevent,t1.fbegdate,t1.fenddate,t1.changedate,t1.createby,t1.createdate