Commit a0131bab authored by chenweijian's avatar chenweijian

家族

parent e5cb1360
...@@ -684,7 +684,7 @@ type GroupPowerStar struct { ...@@ -684,7 +684,7 @@ type GroupPowerStar struct {
} }
type FamilyMemberDetail struct { type FamilyMemberDetail struct {
user_cv.CvUserExtend User user_cv.CvUserExtend
Role groupPower_e.GroupPowerUserRole `json:"role"` Role groupPower_e.GroupPowerUserRole `json:"role"`
} }
......
...@@ -134,7 +134,7 @@ func UpdateFamily(model *domain.Model, familyId uint64, name, nameplate, declara ...@@ -134,7 +134,7 @@ func UpdateFamily(model *domain.Model, familyId uint64, name, nameplate, declara
if icon != "" { if icon != "" {
updateMap["icon"] = icon updateMap["icon"] = icon
} }
result := db.Updates(updateMap).Limit(1) result := db.Where("id = ?", familyId).Updates(updateMap).Limit(1)
if result.Error != nil { if result.Error != nil {
return myerr.WrapErr(result.Error) return myerr.WrapErr(result.Error)
} }
......
...@@ -899,8 +899,8 @@ func GroupPowerMembers(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -899,8 +899,8 @@ func GroupPowerMembers(c *gin.Context) (*mycontext.MyContext, error) {
for _, v := range members { for _, v := range members {
result = append(result, group_power_cv.FamilyMemberDetail{ result = append(result, group_power_cv.FamilyMemberDetail{
CvUserExtend: users[v.UserId], User: users[v.UserId],
Role: v.Role, Role: v.Role,
}) })
} }
} }
...@@ -1343,13 +1343,13 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -1343,13 +1343,13 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) {
return myContext, err return myContext, err
} }
type param struct { type param struct {
Id uint64 `json:"id"` Id uint64 `form:"id"`
Name string `json:"name"` Name string `form:"name"`
Nameplate string `json:"nameplate"` // 铭牌 Nameplate string `form:"nameplate"` // 铭牌
Declaration string `json:"declaration"` // 宣言 Declaration string `form:"declaration"` // 宣言
Icon string `json:"icon"` // 头像 Icon string `form:"icon"` // 头像
} }
para := new(param) var para param
if err := c.ShouldBind(&para); err != nil { if err := c.ShouldBind(&para); err != nil {
return myContext, err return myContext, err
} }
...@@ -1392,7 +1392,7 @@ func GroupPowerSetInfo(c *gin.Context) (*mycontext.MyContext, error) { ...@@ -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 { if err != nil {
return myContext, myerr.WrapErr(err) 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