CrazyIter_Bin 2 years ago
parent
commit
7ad2f09c35

+ 1 - 1
TEAMModelOS.SDK/Models/Service/LessonService.cs

@@ -35,7 +35,7 @@ namespace TEAMModelOS.SDK.Models.Service
                     dict.Add("tmdid", tmdid);
                 }
                 else if(tmdid.ValueKind.Equals(JsonValueKind.Array)) {
-                    dict.Add("tmdid[*]", tmdid);
+                    dict.Add("tmdid", tmdid);
                 }
             }
             if (request.TryGetProperty("courseId", out JsonElement courseId) && !string.IsNullOrWhiteSpace($"{courseId}"))

+ 4 - 0
TEAMModelOS/Controllers/Both/LessonRecordController.cs

@@ -391,6 +391,10 @@ namespace TEAMModelOS.Controllers
                 sql_status_managePage = "";
             }
             cosmosDbQuery.QueryText = cosmosDbQuery.QueryText.Replace("where", $" where {sql_status_managePage} array_length(c.groupIds)>0 {sqlPrivate} {sqlShow}  and  ");
+            if (request.TryGetProperty("singleGreen", out JsonElement doubleGreen) && doubleGreen.GetBoolean())
+            {
+                cosmosDbQuery.QueryText = cosmosDbQuery.QueryText.Replace("where", $" where  ((c.tLevel=2 and c.pLevel<2 )or(c.tLevel<2 and c.pLevel=2 )) and   ");
+            }
             List<LessonRecord> records = new List<LessonRecord>();
             await foreach (var item in _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, tbname).GetItemQueryIterator<LessonRecord>(queryDefinition: cosmosDbQuery.CosmosQueryDefinition, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey(code) }))
             {