Explorar o código

根据handle_time倒序查询operationHis

longan %!s(int64=2) %!d(string=hai) anos
pai
achega
53ae1afeff
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      app/system/dao/operationHisDao.go

+ 1 - 1
app/system/dao/operationHisDao.go

@@ -39,7 +39,7 @@ func (c OperationHistory) GetHistories(offset, limit int) ([]OperationHistory, i
 		db = db.Where("object like ?", "%"+c.Object+"%")
 	}
 
-	err := db.Offset(offset).Limit(limit).Find(&list).Error
+	err := db.Order("handle_time DESC").Offset(offset).Limit(limit).Find(&list).Error
 	db.Count(&counts)
 	return list, counts, err
 }