fix($task): 修复任务列表页总记录数显示错误

pull/21/merge
ouqiang 2017-09-06 09:43:13 +08:00
parent d642c9641d
commit d4e0898674
1 changed files with 5 additions and 1 deletions

View File

@ -229,7 +229,11 @@ func (task *Task) GetDependencyTaskList(ids string) ([]Task, error) {
func (task *Task) Total(params CommonMap) (int64, error) {
session := Db.Alias("t").Join("LEFT", taskHostTableName(), "t.id = th.task_id")
task.parseWhere(session, params)
return session.GroupBy("t.id").Count(task)
list := make([]Task, 0)
err := session.GroupBy("t.id").Find(&list)
return int64(len(list)), err
}
// 解析where