select t1.tenterprise_userid,t1.fname, t1.fphonenumber,MAX(t4.createdate) as flastreadtime,count(t4.tarchives_userdaid)freadcount,
       sum(DATEDIFF(MINUTE,t4.createdate,t4.closedate)) freadtimes
from tenterprise_users t1
       inner join tarchives_userdata t4 on t1.siteid=t4.siteid and t1.tenterprise_userid=t4.tenterprise_userid and t4.tarchivesid = $tarchivesid$
where t1.siteid = $siteid$ and t1.fusertype = 'ÆóÒµ' and t1.tenterprise_userid in $tenterprise_userid$
group by t1.tenterprise_userid,t1.fname, t1.fphonenumber