1
0
mirror of https://github.com/beego/bee.git synced 2024-11-13 04:50:54 +00:00

Update g_model.go

This commit is contained in:
Shimon 2019-07-11 18:00:18 +08:00 committed by GitHub
parent d511719703
commit e86aad1be3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -224,11 +224,11 @@ func GetAll{{modelName}}(query map[string]string, fields []string, sortby []stri
}
}
m := make(map[string]interface{})
result := make(map[string]interface{})
if i, ex := qs.Count(); ex != nil {
return nil, errors.New("Error: get total record failed")
} else {
m["TotalRecord"] = i
result["TotalRecord"] = i
}
var l []{{modelName}}
@ -250,8 +250,8 @@ func GetAll{{modelName}}(query map[string]string, fields []string, sortby []stri
list = append(list, m)
}
}
m["List"] = list
return m, nil
result["List"] = list
return result, nil
}else {
return nil, err
}