select t1.tenterprise_userid,
       t1.fname,
       t2.fstorename,
       t1.frole,
       t1.fsex,
       t1.fshortcode,
       t1.fbirthdate,
       t1.femail,
       t1.fphonenumber,
       t1.fwechatno,
       t1.faccountno,
       t3.fagentname,
       t3.fprovince,
       t3.fcity,
       t3.fcounty,
       t3.faddress
from tenterprise_users t1
         left join tstore t2 on t1.siteid = t2.siteid and t1.tagentsid = t2.tagentsid and t1.tstoreid = t2.tstoreid
         left join tagents t3 on t1.siteid = t3.siteid and t1.tagentsid = t3.tagentsid
where t1.siteid =$siteid$ and t1.tagentsid=$tagentsid$ and t1.tenterprise_userid=$userid$