Commit c5cdad87 authored by hujiebin's avatar hujiebin

DelMedal

parent 074019e5
...@@ -41,7 +41,7 @@ func ats32(a interface{}) string { ...@@ -41,7 +41,7 @@ func ats32(a interface{}) string {
} }
func main() { 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" method := "GET"
client := &http.Client{} client := &http.Client{}
...@@ -95,7 +95,7 @@ func main() { ...@@ -95,7 +95,7 @@ func main() {
for _, v := range svips { for _, v := range svips {
svipMap[v.Code] = v.Level svipMap[v.Code] = v.Level
} }
excelFileName := fmt.Sprintf("./0827水果机中奖榜.xlsx") excelFileName := fmt.Sprintf("./0830水果机中奖榜.xlsx")
xlFile := xlsx.NewFile() xlFile := xlsx.NewFile()
sheet, _ := xlFile.AddSheet("charge") sheet, _ := xlFile.AddSheet("charge")
row := sheet.AddRow() row := sheet.AddRow()
......
...@@ -14,8 +14,12 @@ func SendMedal(model *domain.Model, userId, medalId mysql.ID, day int) error { ...@@ -14,8 +14,12 @@ func SendMedal(model *domain.Model, userId, medalId mysql.ID, day int) error {
MedalId: uint32(medalId), MedalId: uint32(medalId),
EndTime: &endTime, EndTime: &endTime,
} }
if err := um.Create(model.Db, day); err != nil { if err := um.Create(model.DB(), day); err != nil {
return err return err
} }
return nil 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
}
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