|
|
@@ -10,9 +10,9 @@ select t1.tagentsid,
|
|
|
--(stuff((select ',' + fprodclassname from tagents_prodclass where siteid = t1.siteid and tagentsid=t1.tagentsid for xml path('')),1,1,'')) as fprodclassname,
|
|
|
count(t2.tenterprise_userid) as fteamsize,
|
|
|
max(t3.flastrequestdate)as flastrequestdate,
|
|
|
- isnull(t1.saleprodclass,[])as saleprodclass
|
|
|
+ isnull(t1.saleprodclass,'[]')as saleprodclass
|
|
|
from tagents t1
|
|
|
inner join tenterprise_users t2 on t1.siteid=t2.siteid and t1.tagentsid=t2.tagentsid
|
|
|
left join tuserrequestlog t3 on t1.siteid = t3.siteid and t2.tenterprise_userid = t3.tenterprise_userid
|
|
|
where t1.siteid =$siteid$ and $where$ and t1.ftype!='¸öÈË'
|
|
|
-group by t1.tagentsid,t1.siteid,t1.createdate,t1.fagentname,t1.faddress,t1.fcontact,t1.fphonenumber,t1.fbrand,t1.fisused
|
|
|
+group by t1.tagentsid,t1.siteid,t1.createdate,t1.fagentname,t1.faddress,t1.fcontact,t1.fphonenumber,t1.fbrand,t1.fisused,t1.saleprodclass
|