select
t1.tstoreid,t1.fstorenum,t1.fstorename,t1.fprovince,t1.fcity,t1.fcounty,t1.faddress,
t1.fcontact,t1.fwechatno,t1.femail,t1.fphonenumber,
t1.fstartdate,t1.fmarket,t1.fstoretype,t1.farea,t1.fstatus,t2.fagentnum,t2.fagentname from tstore t1
inner join tagents t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid

where t1.siteid=$siteid$ and t1.tagentsid=$tagentsid$ and t1.tstoreid=$tstoreid$