Commit 6747b236 authored by szh's avatar szh

add table

parent ae5f3447
......@@ -33,7 +33,7 @@ func AddFeedBackList(fd RaspFeedbackList)bool{
func GetAddrFeedBackList(req *ReqRaspFeedbackList) ([]*RaspFeedbackList, error) {
var txs []*RaspFeedbackList
maps := map[string]interface{}{"addr":req.Addr}
err := db.Where(maps).Order("id "+"desc").Offset((req.Page-1)*req.Pagesize).Limit(req.Pagesize).Find(&txs).Error
err := db.Model(&RaspFeedbackList{}).Where(maps).Order("id "+"desc").Offset((req.Page-1)*req.Pagesize).Limit(req.Pagesize).Find(&txs).Error
if err != nil && err != gorm.ErrRecordNotFound {
return nil, err
}
......@@ -44,6 +44,6 @@ func GetAddrFeedBackList(req *ReqRaspFeedbackList) ([]*RaspFeedbackList, error)
func GetAddrFeedBackCount(addr string) int64 {
maps := map[string]interface{}{"addr":addr}
var count int64
db.Where(maps).Count(&count)
db.Model(&RaspFeedbackList{}).Where(maps).Count(&count)
return count
}
\ No newline at end of file
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