select t1.tenterprise_userid,t3.fname fsaler, t1.fname, t2.fprovince, t2.fcity, t2.fcounty, t1.fphonenumber
from tenterprise_users t1
       inner join tagents t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid
       inner join tenterprise_users t3 on t2.siteid = t3.siteid and t2.fsaleruserid = t3.tenterprise_userid
       left 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 t4.tarchives_userdaid is null  and t1.fisadministrator=1 and t1.fusertype = '¾­ÏúÉÌ'
group by t1.tenterprise_userid,t3.fname , t1.fname, t2.fprovince, t2.fcity, t2.fcounty, t1.fphonenumber