fix
liuxiaolong
2020-08-17 7622abfd473ba097b4cc590adedb6c04d8d64ef6
fix
1个文件已修改
5 ■■■■■ 已修改文件
models/log.go 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/log.go
@@ -27,10 +27,9 @@
    var list []*Log
    o := orm.NewOrm()
    var total int
    sql := "select count(*) from "+l.TableName()+" where createTime >='"+startTime+"' and createTime <= '"+endTime+"'"
    o.Raw(sql).QueryRow(&total)
    o.Raw("select count(*) from "+l.TableName()+" where createTime >='"+startTime+"' and createTime <= '"+endTime+"'").QueryRow(&total)
    sn := (curPage-1)*pageSize
    sql += " order by createTime desc limit "+strconv.Itoa(sn)+","+strconv.Itoa(pageSize)+""
    sql := "select * from "+l.TableName()+" where createTime >='"+startTime+"' and createTime <= '"+endTime+"' order by createTime desc limit "+strconv.Itoa(sn)+","+strconv.Itoa(pageSize)+""
    o.Raw(sql).QueryRows(&list)
    return total, list
}