Skip to content
This repository has been archived by the owner on Nov 29, 2020. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mohuishou committed Jul 14, 2018
1 parent 4b48184 commit 423a615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions model/grade.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,12 +110,12 @@ func UpdateGrades(userID uint) ([]Grade, error) {

// 新增更新的数据
updateGrades, _ := grades.Difference(oldGrades)
log.Printf("%d 需要新增成绩: %d条", userID, len(ids))
log.Printf("%d 需要新增成绩: %d条", userID, len(updateGrades))

updates := make(Grades, 0)
for _, g := range updateGrades {
if err := DB().Create(&g).Error; err != nil {
log.Println("grade create err:", err)
log.Println("grade create err:", g, err)
} else {
updates = append(updates, g)
}
Expand Down

0 comments on commit 423a615

Please sign in to comment.