|
|
@@ -209,18 +209,26 @@ select u.accountname brokername, a.*
|
|
|
to_number(t.brokerid) brokerid,
|
|
|
t.birthday birthday2
|
|
|
from wskh_userinfo t
|
|
|
- start with t.areaid = %v
|
|
|
- connect by prior t.userid = t.areaid
|
|
|
- and t.usertype in (2, 6)
|
|
|
- and level = %v) a
|
|
|
+ where 1=1 %v) a
|
|
|
left join useraccount u
|
|
|
on a.brokerid = u.userid
|
|
|
where 1 = 1
|
|
|
- and a.usertype != 2
|
|
|
and a.status in (%v)
|
|
|
`
|
|
|
+ var strParm string
|
|
|
+ if r.IncludeSub == 0 {
|
|
|
+ strParm = fmt.Sprintf(" and t.areaid = %v", r.USERID)
|
|
|
+ } else {
|
|
|
+ str := `
|
|
|
+ and t.areaid in (select t.userid
|
|
|
+ from useraccount t
|
|
|
+ where t.subarealevelpath like ',%%%v%%,'
|
|
|
+ and t.usertype=2)
|
|
|
+ `
|
|
|
+ strParm = fmt.Sprintf(str, r.USERID)
|
|
|
+ }
|
|
|
status := DecodeStr(r.QUERYTYPE == 1, "1", "2,4,5")
|
|
|
- sqlId.FormatParam(r.USERID, r.level(), status)
|
|
|
+ sqlId.FormatParam(strParm, status)
|
|
|
sqlId.AndEx("a.USERINFOTYPE", r.USERINFOTYPE, r.USERINFOTYPE > 0)
|
|
|
sqlId.JoinEx(len(r.CUSTOMERNAME) > 0, fmt.Sprintf(` and a.customername like '%%%v%%'`, r.CUSTOMERNAME))
|
|
|
sqlId.JoinEx(len(r.NICKNAME) > 0, fmt.Sprintf(` and a.nickname like '%%%v%%'`, r.NICKNAME))
|