This commit is contained in:
yangduo 2024-12-06 23:02:19 +08:00
parent c03212df1c
commit 9e77777f81

View File

@ -163,27 +163,20 @@ func (this *User) UpdateName() error {
func (this *User) AddAwardGrid(gridid int32) error {
awardGridsList := this.GetAwardGrids()
if len(awardGridsList) > 1 {
if len(awardGridsList) > 0 {
this.awardGrids += ","
}
this.awardGrids += q5.SafeToString(gridid)
if err := this.UpdateFields([]string{"award_grids"}); err != nil {
return err
}
return nil
return this.UpdateFields([]string{"award_grids"})
}
func (this *User) ClearAwardGrid() error {
this.awardGrids = ""
if err := this.UpdateFields([]string{"award_grids"}); err != nil {
return err
}
return nil
return this.UpdateFields([]string{"award_grids"})
}
func (this *User) GetAwardGrids() []int32 {
gridstr := strings.Split(this.awardGrids, ",")
awardGridsList := []int32{}
for _, item := range gridstr {