Li 2 年之前
父節點
當前提交
b4da809a34

+ 2 - 2
TEAMModelBI/Controllers/Census/ActivitySticsController.cs

@@ -587,7 +587,7 @@ namespace TEAMModelBI.Controllers.Census
             termActivity = await ActivityWay.GetCnt(cosmosClient, termSql);
 
             string monthActSql = $" and c.createTime >= {monthS}  and c.createTime <={monthE}";
-            monthActCnt = await ActivityWay.GetCnt(cosmosClient, termSql);
+            monthActCnt = await ActivityWay.GetCnt(cosmosClient, monthActSql);
 
             //课例
             string allLessSql = $"select value(count(c.id)) from c where c.pk='LessonRecord'";
@@ -600,7 +600,7 @@ namespace TEAMModelBI.Controllers.Census
             termLess = await CommonFind.GetSqlValueCount(cosmosClient, "School", termLSql);
 
             string monthLSql = $"{allLessSql} and c.startTime >= {monthS}  and c.startTime <={monthE}";
-            monthLesCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", termLSql);
+            monthLesCnt = await CommonFind.GetSqlValueCount(cosmosClient, "School", monthLSql);
 
             totalTime = await CommonFind.GetSqlValueCount(cosmosClient, "Teacher", "select value(sum(c.totalTime)) from c where c.pk='TeacherTrain'");
             resourceCount = await CommonFind.GetSqlValueCount(cosmosClient, new List<string>() { "School", "Teacher" }, "select value(count(c.id)) from c where c.pk='Bloblog'");

+ 5 - 1
TEAMModelBI/Controllers/Census/LessonSticsController.cs

@@ -530,9 +530,13 @@ namespace TEAMModelBI.Controllers.Census
         /// </summary>
         /// <returns></returns>
         [HttpPost("get-allarea")]
-        public async Task<IActionResult> GetAllArea()
+        public async Task<IActionResult> GetAllArea(JsonElement jsonElement)
         {
+            jsonElement.TryGetProperty("site", out JsonElement site);
+
             var cosmosClient = _azureCosmos.GetCosmosClient();
+            if ($"{site}".Equals(BIConst.Global))
+                cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
 
             List<AllAreaInfo> areaInfos = new();
             await foreach (var item in cosmosClient.GetContainer("TEAMModelOS", "Normal").GetItemQueryIterator<AllAreaInfo>(queryText: $"select c.id,c.name,c.standard,c.standardName from c", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey("Base-Area") }))