Commit 87d5e7a2 authored by hujiebin's avatar hujiebin

accountId

parent 97d18758
......@@ -45,7 +45,7 @@ func ats33(a interface{}) string {
}
func main() {
url := "https://apiv2.faceline.live/v1/race/rank/award?lang=zh-cn&pageIndex=1&pageSize=50000&beginDate=2023-08-18&endDate=2023-08-18&userCode=&timezone=1"
url := "https://apiv2.faceline.live/v1/race/rank/award?lang=zh-cn&pageIndex=1&pageSize=50000&beginDate=2023-08-20&endDate=2023-08-20&userCode=&timezone=1"
method := "GET"
client := &http.Client{}
......@@ -99,7 +99,7 @@ func main() {
for _, v := range svips {
svipMap[v.Code] = v.Level
}
excelFileName := fmt.Sprintf("./0818赛车中奖榜.xlsx")
excelFileName := fmt.Sprintf("./0820赛车中奖榜.xlsx")
xlFile := xlsx.NewFile()
sheet, _ := xlFile.AddSheet("charge")
row := sheet.AddRow()
......
......@@ -102,10 +102,10 @@ func TxAddReduceDiamondAccount(model *domain.Model, userId mysql.ID, operateType
var db *gorm.DB
if diamondOperateSet.AddReduce == mysql.ADD {
//增加
db = model.DB().Model(diamond_m.DiamondAccount{}).UpdateColumn("diamond_num", gorm.Expr("diamond_num + ?", diamondNum))
db = model.DB().Model(diamond_m.DiamondAccount{}).Where("id = ?", diamondAccount.ID).UpdateColumn("diamond_num", gorm.Expr("diamond_num + ?", diamondNum))
} else if diamondOperateSet.AddReduce == mysql.REDUCE {
//减少,保证不能扣成负数
db = model.DB().Model(diamond_m.DiamondAccount{}).Where("diamond_num >= ?", diamondNum).UpdateColumn("diamond_num", gorm.Expr("diamond_num - ?", diamondNum))
db = model.DB().Model(diamond_m.DiamondAccount{}).Where("id = ?", diamondAccount.ID).Where("diamond_num >= ?", diamondNum).UpdateColumn("diamond_num", gorm.Expr("diamond_num - ?", diamondNum))
} else {
return myerr.NewSysErrorF("addReduce 枚举错误 value:", diamondOperateSet.AddReduce)
}
......
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