瀏覽代碼

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

jeff 1 年之前
父節點
當前提交
bca2521788
共有 1 個文件被更改,包括 2 次插入2 次删除
  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;             
                 }
             }