Skip to content

Commit

Permalink
优化,合并update方法 (flipped-aurora#1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
myface-wang authored Sep 1, 2022
1 parent e54e587 commit 88f5a84
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/service/example/exa_breakpoint_continue.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ func (e *FileUploadAndDownloadService) CreateFileChunk(id uint, fileChunkPath st
func (e *FileUploadAndDownloadService) DeleteFileChunk(fileMd5 string, filePath string) error {
var chunks []example.ExaFileChunk
var file example.ExaFile
err := global.GVA_DB.Where("file_md5 = ? ", fileMd5).First(&file).Update("IsFinish", true).Update("file_path", filePath).Error
err := global.GVA_DB.Where("file_md5 = ? ", fileMd5).First(&file).
Updates(map[string]interface{}{
"IsFinish": true,
"file_path": filePath,
}).Error
if err != nil {
return err
}
Expand Down

0 comments on commit 88f5a84

Please sign in to comment.