Commit a0131bab authored by chenweijian's avatar chenweijian

家族

parent e5cb1360
......@@ -684,7 +684,7 @@ type GroupPowerStar struct {
}
type FamilyMemberDetail struct {
user_cv.CvUserExtend
User user_cv.CvUserExtend
Role groupPower_e.GroupPowerUserRole `json:"role"`
}
......
......@@ -134,7 +134,7 @@ func UpdateFamily(model *domain.Model, familyId uint64, name, nameplate, declara
if icon != "" {
updateMap["icon"] = icon
}
result := db.Updates(updateMap).Limit(1)
result := db.Where("id = ?", familyId).Updates(updateMap).Limit(1)
if result.Error != nil {
return myerr.WrapErr(result.Error)
}
......
......@@ -899,7 +899,7 @@ func GroupPowerMembers(c *gin.Context) (*mycontext.MyContext, error) {
for _, v := range members {
result = append(result, group_power_cv.FamilyMemberDetail{
CvUserExtend: users[v.UserId],
User: users[v.UserId],
Role: v.Role,
})
}
......@@ -1343,13 +1343,13 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) {
return myContext, err
}
type param struct {
Id uint64 `json:"id"`
Name string `json:"name"`
Nameplate string `json:"nameplate"` // 铭牌
Declaration string `json:"declaration"` // 宣言
Icon string `json:"icon"` // 头像
Id uint64 `form:"id"`
Name string `form:"name"`
Nameplate string `form:"nameplate"` // 铭牌
Declaration string `form:"declaration"` // 宣言
Icon string `form:"icon"` // 头像
}
para := new(param)
var para param
if err := c.ShouldBind(&para); err != nil {
return myContext, err
}
......@@ -1392,7 +1392,7 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) {
}
// 修改家族信息
err = groupPower_m.UpdateFamily(model, userId, para.Name, para.Nameplate, para.Declaration, para.Icon)
err = groupPower_m.UpdateFamily(model, para.Id, para.Name, para.Nameplate, para.Declaration, para.Icon)
if err != nil {
return myContext, myerr.WrapErr(err)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment