|
@@ -384,7 +384,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
{
|
|
|
if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
- var query = $"select c.id,c.img,c.name,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.progress from c ";
|
|
|
+ var query = $"select c.id,c.img,c.name,c.type,c.startTime,c.endTime,c.presenter,c.topic,c.address,c.owner,c.progress from c where (c.status<>-1 or IS_DEFINED(c.status) = false ) ";
|
|
|
string continuationToken = string.Empty;
|
|
|
string token = default;
|
|
|
//是否需要进行分页查询,默认不分页
|
|
@@ -531,7 +531,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
if (!requert.TryGetProperty("code", out JsonElement code)) return BadRequest();
|
|
|
if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
- var query = $"select c.id,c.img,c.name,c.startTime,c.type,c.endTime,c.presenter,c.topic,c.address,c.owner from c join A0 in c.teachers where A0.id = '{tId}'";
|
|
|
+ var query = $"select c.id,c.img,c.name,c.startTime,c.type,c.endTime,c.presenter,c.topic,c.address,c.owner from c join A0 in c.teachers where (c.status<>-1 or IS_DEFINED(c.status) = false ) and A0.id = '{tId}'";
|
|
|
List<object> studies = new();
|
|
|
await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{code}") }))
|
|
|
{
|
|
@@ -568,7 +568,7 @@ namespace TEAMModelOS.Controllers.Common
|
|
|
if (!requert.TryGetProperty("tId", out JsonElement tId)) return BadRequest();
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
List<object> studies = new();
|
|
|
- await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers where A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{code}") }))
|
|
|
+ await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: $"select value(c) from c join A0 in c.teachers where (c.status<>-1 or IS_DEFINED(c.status) = false ) and A0.id = '{tId}' and c.id = '{id}'", requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Study-{code}") }))
|
|
|
{
|
|
|
using var json = await JsonDocument.ParseAsync(item.ContentStream);
|
|
|
if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
|