sunsheng 1 年之前
父节点
当前提交
8163204a74
共有 1 个文件被更改,包括 0 次插入36 次删除
  1. 0 36
      src/api/exeamLog.go

+ 0 - 36
src/api/exeamLog.go

@@ -116,42 +116,6 @@ func LatestExamExportExcel(c *gin.Context, apictx *ApiSession) (interface{}, err
 	return nil, nil
 }
 
-// func getTotalLearnTime(apictx *ApiSession, db string, uid string) (int32, error) {
-
-// 	// 可以查询learn_log_statistics,数据量小些
-// 	colls := apictx.CreateRepoCtx().Client.GetDbCollection(db, repo.CollectionLearnLogStatistics)
-
-// 	// colls := apictx.CreateRepoCtx().Client.GetDbCollection(db, repo.CollectionLearnLog)
-
-// 	// 定义聚合管道
-// 	pipeline := mongo.Pipeline{
-// 		{{Key: "$match", Value: bson.D{{Key: "uid", Value: uid}}}},
-// 		{{Key: "$group", Value: bson.D{
-// 			{Key: "_id", Value: "$uid"},
-// 			{Key: "totalLearnTime", Value: bson.D{{Key: "$sum", Value: "$learnTime"}}},
-// 		}}},
-// 	}
-
-// 	// 执行聚合管道
-// 	cursor, err := colls.Aggregate(apictx.CreateRepoCtx().Ctx, pipeline)
-// 	if err != nil {
-// 		log.Error(err)
-// 		return 0, err
-// 	}
-
-// 	// 遍历结果
-// 	var results []bson.M
-// 	if err = cursor.All(apictx.CreateRepoCtx().Ctx, &results); err != nil {
-// 		log.Error(err)
-// 		return 0, err
-// 	}
-// 	if len(results) > 0 {
-// 		return results[0]["totalLearnTime"].(int32), err
-// 	}
-
-// 	return 0, nil
-// }
-
 func getHandleLatestExamLog(apictx *ApiSession, db string, examType string) ([]*HandleLatestExamLog, error) {
 	colls := apictx.CreateRepoCtx().Client.GetDbCollection(db, repo.CollectionExeamLog)