|
@@ -792,3 +792,20 @@ func GetPersonalIdentityByMgoId(base *Mysql, mgo *MongodbSim, userId string) *Id
|
|
}
|
|
}
|
|
return nil
|
|
return nil
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+//根据职位id获取用户信息
|
|
|
|
+func GetUserInfoByPosition(base *Mysql, mgo *MongodbSim, id int64) *UserInfo {
|
|
|
|
+ list := base.SelectBySql(`select user_id from base_position where id=?`, id)
|
|
|
|
+ if list == nil || len(*list) == 0 {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ data, ok := mgo.FindOneByField("user", map[string]interface{}{
|
|
|
|
+ "base_user_id": util.Int64All((*list)[0]["user_id"]),
|
|
|
|
+ }, `{"_id":1}`)
|
|
|
|
+ if !ok || data == nil || len(*data) == 0 {
|
|
|
|
+ return nil
|
|
|
|
+ }
|
|
|
|
+ return &UserInfo{
|
|
|
|
+ Id: BsonIdToSId((*data)["_id"]),
|
|
|
|
+ }
|
|
|
|
+}
|