Selaa lähdekoodia

处理系统管理员统计数据异常信息的问题。

Li 2 vuotta sitten
vanhempi
commit
c3d9beebe0

+ 2 - 2
TEAMModelBI/Controllers/BISchool/SchoolController.cs

@@ -1485,11 +1485,11 @@ namespace TEAMModelBI.Controllers.BISchool
                     string tchAllSql = $"select value(count(c.id)) from c where ARRAY_CONTAINS(c.roles,'teacher',true) and c.status = 'join'";
                     string tchAllSql = $"select value(count(c.id)) from c where ARRAY_CONTAINS(c.roles,'teacher',true) and c.status = 'join'";
                     tchAllCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", tchAllSql, $"Teacher-{item.id}");
                     tchAllCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", tchAllSql, $"Teacher-{item.id}");
 
 
-                    string lessALLSql = "select value(count(c.id)) from c where c.pk='LessonRecord'";
+                    string lessALLSql = $"select value(count(c.id)) from c where c.pk='LessonRecord'";
                     lessAllCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", lessALLSql, $"LessonRecord-{item.id}");
                     lessAllCnt += await CommonFind.GetSqlValueCount(cosmosClient, "School", lessALLSql, $"LessonRecord-{item.id}");
 
 
                     string lessUpSql = $"select value(count(c.id)) from c where c.pk='LessonRecord' and c.upload = 0";
                     string lessUpSql = $"select value(count(c.id)) from c where c.pk='LessonRecord' and c.upload = 0";
-                    lessRankCnt.openCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", lessMoSql, $"LessonRecord-{item.id}");
+                    lessRankCnt.openCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", lessUpSql, $"LessonRecord-{item.id}");
 
 
                     string lessSql = $"select value(count(c.id)) from c where c.pk='LessonRecord' and c.upload = 1";
                     string lessSql = $"select value(count(c.id)) from c where c.pk='LessonRecord' and c.upload = 1";
                     lessRankCnt.lessCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", lessSql, $"LessonRecord-{item.id}");
                     lessRankCnt.lessCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", lessSql, $"LessonRecord-{item.id}");

+ 1 - 1
TEAMModelBI/Tool/CommonFind.cs

@@ -189,7 +189,7 @@ namespace TEAMModelBI.Tool
         public static async Task<int> GetSqlValueCount(CosmosClient cosmosClient, string container, string SqlTxt,string code = null) 
         public static async Task<int> GetSqlValueCount(CosmosClient cosmosClient, string container, string SqlTxt,string code = null) 
         {
         {
             int totals = 0;
             int totals = 0;
-            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: SqlTxt,requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
+            await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", container).GetItemQueryIterator<int>(queryText: SqlTxt, requestOptions: string.IsNullOrEmpty(code) ? new QueryRequestOptions() { } : new QueryRequestOptions() { PartitionKey = new PartitionKey($"{code}") }))
             {
             {
                 totals = item;
                 totals = item;
             }
             }