|
@@ -293,3 +293,23 @@ func DelCompanyMember(c *gin.Context) {
|
|
|
}
|
|
|
response.Success(c, nil, "删除成功")
|
|
|
}
|
|
|
+
|
|
|
+func GetCompanyMembers(c *gin.Context) {
|
|
|
+ db := common.GetDB()
|
|
|
+ companyId := c.Params.ByName("companyId")
|
|
|
+ type userInfo struct {
|
|
|
+ Id string `json:"id" gorm:"column:"`
|
|
|
+ Username string `json:"username"`
|
|
|
+ Tel string `json:"tel"`
|
|
|
+ IsLogin string `json:"is_Login"`
|
|
|
+ Identify int `json:"identify"`
|
|
|
+ }
|
|
|
+ var users []userInfo
|
|
|
+
|
|
|
+ if err := db.Raw("SELECT user.id,username,tel,is_login,identify from `user`,`company_users` WHERE "+
|
|
|
+ "company_users.user_id = user.id and state = 1 and company_id = ?", companyId).Find(&users).Error; err != nil {
|
|
|
+ response.Fail(c, nil, "数据库错误,获取公司成员失败")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ response.Success(c, gin.H{"userList": users}, "查询成功")
|
|
|
+}
|