mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-26 17:49:15 +01:00
优化主页指标展示
This commit is contained in:
@@ -152,3 +152,16 @@ func RemoveProject(id bson.ObjectId) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func GetProjectCount(filter interface{}) (int, error) {
|
||||
s, c := database.GetCol("projects")
|
||||
defer s.Close()
|
||||
|
||||
count, err := c.Find(filter).Count()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
|
||||
return count, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user