|
@@ -745,3 +745,24 @@ func MonitorTimeOut(pool chan bool, timeout time.Duration, warn string, f func()
|
|
|
}
|
|
|
return true
|
|
|
}
|
|
|
+
|
|
|
+//根据baseUserId获取个人身份信息
|
|
|
+func GetPersonalIdentityByBaseUserId(base, main *Mysql, baseUserId int64) *IdentityInfo {
|
|
|
+ if baseUserId == 0 {
|
|
|
+ return nil
|
|
|
+ }
|
|
|
+ list := base.SelectBySql(`select a.id as position_id , b.person_id ,a.type as position_type, a.account_id,a.person_name from base_position a
|
|
|
+ inner join base_account b on (a.account_id=b.id and a.user_id=? and a.type=0) limit 1`, baseUserId)
|
|
|
+ if list != nil && len(*list) == 1 {
|
|
|
+ identity := &IdentityInfo{
|
|
|
+ PersonId: Int64All((*list)[0]["person_id"]),
|
|
|
+ UserName: ObjToString((*list)[0]["person_name"]),
|
|
|
+ AccountId: Int64All((*list)[0]["account_id"]),
|
|
|
+ PositionId: Int64All((*list)[0]["position_id"]),
|
|
|
+ PositionType: Int64All((*list)[0]["position_type"]),
|
|
|
+ UserId: baseUserId,
|
|
|
+ }
|
|
|
+ return identity
|
|
|
+ }
|
|
|
+ return nil
|
|
|
+}
|