select case when t2.tarchives_userdaid IS null then '未浏览' else '已浏览' end as ftype,
       count(distinct t1.tenterprise_userid)                             as fcount
from tenterprise_users t1
         left join tarchives_userdata t2
                   on t1.siteid = t2.siteid and t1.tenterprise_userid = t2.tenterprise_userid and t2.tarchivesid = $tarchivesid$
         inner join tagents t3 on t1.siteid=t3.siteid and t1.tagentsid=t3.tagentsid
where t1.siteid = $siteid$  and t1.fisadministrator=1 and t1.fusertype = '经销商' and t3.fsaleruserid in $tenterprise_userid$
group by case when t2.tarchives_userdaid IS null then '未浏览'
else'已浏览'end