Skip to content

Releases: tobycroft/gorose-pro

v1.6.0

19 Sep 03:21
Compare
Choose a tag to compare
新增CountGroup功能,解决count与groupby同时使用的时候取出的数据不准确的BUG

v1.5.1

16 Sep 07:36
Compare
Choose a tag to compare

修复原版Count和GroupBy同时使用时会出现的Total(总条数)错误的问题

v1.5.0

22 Jul 09:41
Compare
Choose a tag to compare

支持了极为复杂的where或orwhere场景

func Api_joinNoticeStatus_paginate_unread(student_id, school_id, year, class_id, gender, Type interface{}, limit, page int) gorose.Paginate {
db := tuuz.Db().Table(Table)
m1 := map[string]interface{}{}
m2 := map[string]interface{}{}
m3 := map[string]interface{}{}
m4 := map[string]interface{}{}
db.Fields(Table+".*", "ifnull(is_read,0) as is_read", "ifnull(is_del,0) as is_del", NoticeStatusModel.Table+".uid")
m1[Table+".student_id"] = 0
m2[Table+".student_id"] = 0
m3[Table+".student_id"] = 0
m4[Table+".student_id"] = student_id

if school_id != nil {
m1[Table+".school_id"] = school_id
m2[Table+".school_id"] = school_id
m3[Table+".school_id"] = school_id
m4[Table+".school_id"] = 0
}
if year != nil {
m1[Table+".year"] = year
m2[Table+".year"] = year
m3[Table+".year"] = 0
m4[Table+".year"] = year
}
if class_id != nil {
m1[Table+".class_id"] = class_id
m2[Table+".class_id"] = 0
m3[Table+".class_id"] = 0
//m4[Table+".class_id"] = class_id
}
if gender != nil {
//m1[Table+".gender"] = gender
//m2[Table+".gender"] = gender
}
if Type != nil {
m1[Table+".type"] = Type
m2[Table+".type"] = Type
m3[Table+".type"] = Type
m4[Table+".type"] = Type
}
//db.OrWhere(m1)
//db.OrWhere(m2)
//db.OrWhere(m3)
//db.OrWhere(m4)
db.OrWhere([]interface{}{m1, m2, m3, m4})
db.WhereNull("is_read")
db.LeftJoin(NoticeStatusModel.Table, Table+".id=notice_id")
db.Limit(limit)
db.Page(page)
//fmt.Println(db.Get())
//fmt.Println(db.LastSql())
//return gorose.Paginate{}
ret, err := db.Paginator()
if err != nil {
Log.Dbrr(err, tuuz.FUNCTION_ALL())
return gorose.Paginate{}
} else {
return ret
}
}

v1.4.2

17 Jun 08:48
Compare
Choose a tag to compare
paginate resdata为空时保持[]空数据返回而不是nil

v1.4.1

17 Jun 07:01
Compare
Choose a tag to compare
新增paginate struct

v1.4.0

17 Jun 06:57
Compare
Choose a tag to compare
新增paginate struct

v1.3.4

17 Jun 06:23
Compare
Choose a tag to compare
修复Paginate-where参数被清除的BUG

v1.3.3

16 Jun 10:21
Compare
Choose a tag to compare
修复Paginate翻页偏移问题

Paginate修复

16 Jun 10:07
Compare
Choose a tag to compare
v1.3.2

修复Paginate不可用问题

count前先赋值表尝试修复错误

16 Jun 09:30
Compare
Choose a tag to compare
v1.3.1

先取出数据会导致表被重置,所以需要先计算再取出数据才合理,上古BUG今天细看才发现