Browse Source

修正在線學生數無法正確取得問題

jeff 1 year ago
parent
commit
bca2521788
1 changed files with 2 additions and 2 deletions
  1. 2 2
      TEAMModelBI/Controllers/BIHome/OnLineController.cs

+ 2 - 2
TEAMModelBI/Controllers/BIHome/OnLineController.cs

@@ -153,7 +153,7 @@ namespace TEAMModelBI.Controllers.BIHome
                 }
 
                 var stuDaysOrderBy = stuDays.OrderBy(o => o.Key).ToList();
-                onStuCnt = (int)stuDaysOrderBy[stuDaysOrderBy.Count - 2].Value;
+                onStuCnt = (int)stuDaysOrderBy[stuDaysOrderBy.Count - 1].Value;
             }
             else
             {// 如果redis沒資料去Azure Storage取
@@ -166,7 +166,7 @@ namespace TEAMModelBI.Controllers.BIHome
                         stuDays.Add(item.Hour, item.Student);
                     }
                     var stuDaysOrderBy = stuDays.OrderBy(o => o.Key).ToList();
-                    onStuCnt = (int)stuDaysOrderBy[stuDaysOrderBy.Count - 2].Value;             
+                    onStuCnt = (int)stuDaysOrderBy[stuDaysOrderBy.Count - 1].Value;             
                 }
             }