diff --git a/script/fruit_day_award.go b/script/fruit_day_award.go index 5b5b946bca3eb58dd3338fbc31b5f0bfbcb41f18..90bdcf58135188575483d1c650768e488c8b33ef 100644 --- a/script/fruit_day_award.go +++ b/script/fruit_day_award.go @@ -41,7 +41,7 @@ func ats32(a interface{}) string { } func main() { - url := "https://apiv2.faceline.live/v1/fruitMachine/rank/award?lang=zh-cn&pageIndex=1&pageSize=5000&beginDate=2023-08-27&endDate=2023-08-27&userCode=&timezone=1" + url := "https://apiv2.faceline.live/v1/fruitMachine/rank/award?lang=zh-cn&pageIndex=1&pageSize=5000&beginDate=2023-08-30&endDate=2023-08-30&userCode=&timezone=1" method := "GET" client := &http.Client{} @@ -95,7 +95,7 @@ func main() { for _, v := range svips { svipMap[v.Code] = v.Level } - excelFileName := fmt.Sprintf("./0827水果机中奖榜.xlsx") + excelFileName := fmt.Sprintf("./0830水果机中奖榜.xlsx") xlFile := xlsx.NewFile() sheet, _ := xlFile.AddSheet("charge") row := sheet.AddRow() diff --git a/txop/medal_tx/medal.go b/txop/medal_tx/medal.go index bd70c6d5fc7f38e51d113c04ed5c403080b71149..9e0c979f0fbac298ef33a000f37c42a8b1989871 100644 --- a/txop/medal_tx/medal.go +++ b/txop/medal_tx/medal.go @@ -14,8 +14,12 @@ func SendMedal(model *domain.Model, userId, medalId mysql.ID, day int) error { MedalId: uint32(medalId), EndTime: &endTime, } - if err := um.Create(model.Db, day); err != nil { + if err := um.Create(model.DB(), day); err != nil { return err } return nil } + +func DelMedal(model *domain.Model, userId, medalId mysql.ID) error { + return model.DB().Model(user_m.UserMedal{}).Where("user_id = ? AND medal_id = ?", userId, medalId).Delete(&user_m.UserMedal{}).Error +}