|
@@ -670,10 +670,6 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
(List<LessonCount> scount, List<LessonCount> tcount) = await getCount(client, records, syear, tyear, code, tId, periodId);
|
|
|
DenseMatrix dense = null;
|
|
|
//var response = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemStreamAsync(syear.ToString(), new PartitionKey($"ClassCount-" + code));
|
|
|
- if (tyear > syear)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
if (scount.Count > 0)
|
|
|
{
|
|
|
List<List<double>> begin = new List<List<double>>();
|
|
@@ -684,7 +680,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
var matrix = DenseMatrix.OfColumns(begin);
|
|
|
//求本周
|
|
|
int sday = (int)DateTimeOffset.UtcNow.DayOfWeek;
|
|
|
- //本月
|
|
|
+ //本月第几天
|
|
|
var tmonth = DateTimeOffset.UtcNow.Day;
|
|
|
//求本学期
|
|
|
var sdays = DateTimeOffset.FromUnixTimeMilliseconds(stime).DayOfYear;
|
|
@@ -723,7 +719,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
var subDay = dense.SubMatrix(tday - sday - 1, sday + 1, 0, dense.ColumnCount).ColumnSums().Sum();
|
|
|
counts.Add(("week", subDay));
|
|
|
}
|
|
|
- var subMonth = dense.SubMatrix(tday - tmonth - 1, tmonth + 1, 0, dense.ColumnCount).ColumnSums().Sum();
|
|
|
+ var subMonth = dense.SubMatrix(tday - tmonth, tmonth, 0, dense.ColumnCount).ColumnSums().Sum();
|
|
|
counts.Add(("month", subMonth));
|
|
|
}
|
|
|
else {
|
|
@@ -748,7 +744,7 @@ namespace TEAMModelOS.Controllers.Analysis
|
|
|
counts.Add(("today", tcounts));
|
|
|
var subDay = matrix.SubMatrix(tday - sday - 1, sday + 1, 0, matrix.ColumnCount).ColumnSums().Sum();
|
|
|
counts.Add(("week", subDay));
|
|
|
- var subMonth = matrix.SubMatrix(tday - tmonth - 1, tmonth + 1, 0, matrix.ColumnCount).ColumnSums().Sum();
|
|
|
+ var subMonth = matrix.SubMatrix(tday - tmonth, tmonth, 0, matrix.ColumnCount).ColumnSums().Sum();
|
|
|
counts.Add(("month", subMonth));
|
|
|
//var allMonth = matrix.SubMatrix(sdays - 1, tday - sdays + 1, 0, matrix.ColumnCount).ColumnSums().Sum();
|
|
|
//counts.Add(("semester", allMonth));
|