Forráskód Böngészése

班级加入year调整

zhouj1203@hotmail.com 4 éve
szülő
commit
cb33e7293a
1 módosított fájl, 2 hozzáadás és 2 törlés
  1. 2 2
      TEAMModelOS/Controllers/School/ClassController.cs

+ 2 - 2
TEAMModelOS/Controllers/School/ClassController.cs

@@ -91,7 +91,7 @@ namespace TEAMModelOS.Controllers
                     else
                     {*/
                         List<string> resultIds = new List<string>();
-                        await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.periodId = '{classroom.periodId}' and c.no = '{classroom.no}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
+                        await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.periodId = '{classroom.periodId}' and c.no = '{classroom.no}' and c.year = '{classroom.year}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
                         {
                             using var json = await JsonDocument.ParseAsync(item.ContentStream);
                             if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
@@ -133,7 +133,7 @@ namespace TEAMModelOS.Controllers
                         if (!@class.no.Equals(classroom.no))
                         {
                             List<string> resultIds = new List<string>();
-                            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.periodId = '{classroom.periodId}' and c.no = '{classroom.no}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
+                            await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(queryText: $"select c.id from c where c.year = '{classroom.year}' and c.no = '{classroom.no}' and c.periodId = '{classroom.periodId}' ", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Class-{school_code}") }))
                             {
                                 using var document = await JsonDocument.ParseAsync(item.ContentStream);
                                 if (document.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)