支持search
This commit is contained in:
1 parent
de67c5dc46
commit
65c4cfd684
6 files changed
+61
-224
No files matched your search
+3
-2
@@ -78,7 +78,8 @@ func (e *SysJob) Get() (SysJob, error) {
|
||||
func (e *SysJob) GetPage(pageSize int, pageIndex int, v interface{}) ([]SysJob, int, error) {
|
||||
var doc []SysJob
|
||||
|
||||
table := orm.Eloquent.Select("*").Table(e.TableName())
|
||||
//table := orm.Eloquent.Select("*").Table(e.TableName())
|
||||
table := orm.Eloquent.Table(e.TableName())
|
||||
|
||||
table = tools.SetQuery(table, v)
|
||||
|
||||
@@ -118,7 +119,7 @@ func (e *SysJob) GetPage(pageSize int, pageIndex int, v interface{}) ([]SysJob,
|
||||
if err := table.Offset((pageIndex - 1) * pageSize).Limit(pageSize).Find(&doc).Error; err != nil {
|
||||
return nil, 0, err
|
||||
}
|
||||
table.Where("`deleted_at` IS NULL").Count(&count)
|
||||
table.Count(&count)
|
||||
return doc, int(count), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user