Signed-off-by: jagger <cossjie@foxmail.com>

Former-commit-id: 8bb7ace86b617d878c0d83ce641d4b373cfcf349
This commit is contained in:
jagger 2024-03-29 10:48:50 +08:00
parent 6d6ee06022
commit ec761c8a2c
1 changed files with 3 additions and 1 deletions

View File

@ -30,14 +30,16 @@ func (l *PageListTaskLogic) PageListTask(req *types.PageTaskReq) (resp *types.Pa
resp = &types.PageResult{}
var list []types.TaskModel
db := l.svcCtx.DbEngin.Model(&types.TaskModel{}).Table("task")
db = db.Where("deleted_at is null")
if req.Name != "" {
db = db.Where("name LIKE ?", "%"+req.Name+"%")
}
db = db.Where("deleted_at is null").Limit(limit).Offset(offset)
//count total
var total int64
err = db.Count(&total).Error
db.Limit(limit).Offset(offset)
if err != nil {
return resp, err