|
|
@@ -1,7 +1,7 @@
|
|
|
-select distinct t1.tenterprise_userid as userid
|
|
|
+select distinct t1.tenterprise_userid as userid,tagentsid
|
|
|
from tenterprise_users t1
|
|
|
inner join tenterprise t2 on t1.siteid = t2.siteid and (fenddate is null or fenddate > getdate())
|
|
|
- inner join tuserrequestlog t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
|
|
|
+ --inner join tuserrequestlog t3 on t1.siteid=t3.siteid and t1.tenterprise_userid=t3.tenterprise_userid
|
|
|
inner join tappmodelauth t5 on t1.siteid = t5.siteid and t5.fisdefault = 1
|
|
|
where ((t1.fusertype = '¾ÏúÉÌ' and t5.fagentamount > 0) or
|
|
|
(t1.fusertype = 'ÆóÒµ' and t5.fenterpriseuseramount > 0))
|
|
|
@@ -11,5 +11,6 @@ where ((t1.fusertype = '
|
|
|
(t1.fusertype = '¾ÏúÉÌ' and t1.tagentsid = tpayinfo.tagentsid) or
|
|
|
(t1.fusertype = 'ÆóÒµ' and t1.tenterprise_userid = tpayinfo.tenterprise_userid)
|
|
|
)
|
|
|
- )
|
|
|
-group by t1.tenterprise_userid having max(t3.flastrequestdate)>DATEADD(DAY,-3, GETDATE())
|
|
|
+ )and isnull(t1.accesstoken,'') !=''
|
|
|
+group by t1.tenterprise_userid,tagentsid
|
|
|
+--having max(t3.flastrequestdate)>DATEADD(DAY,-3, GETDATE())
|