|
@@ -78,7 +78,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
|
|
|
|
if (isManyArea)
|
|
if (isManyArea)
|
|
{
|
|
{
|
|
- sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c join m in c.manyAreas WHERE c.areaId ='{_areaId}' or m.areaId='{_areaId}'";
|
|
|
|
|
|
+ sqltxt = $"SELECT c.id,c.name,c.schoolCode,c.province,c.city,c.dist,c.picture,c.period,c.areaId,c.standard,c.manyAreas FROM c join m in c.manyAreas WHERE (c.areaId ='{_areaId}' or m.areaId='{_areaId}')";
|
|
}
|
|
}
|
|
|
|
|
|
await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
|
|
await foreach (var item in cosmosClient.GetContainer(Constant.TEAMModelOS, "School").GetItemQueryStreamIterator(queryText: sqltxt, requestOptions:new QueryRequestOptions() { PartitionKey = new PartitionKey("Base")}))
|
|
@@ -88,7 +88,7 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
{
|
|
{
|
|
foreach(var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
|
|
foreach(var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
|
|
{
|
|
{
|
|
- JoinAreaSchool joinAreaSchool = new JoinAreaSchool
|
|
|
|
|
|
+ JoinAreaSchool joinAreaSchool = new()
|
|
{
|
|
{
|
|
id = obj.GetProperty("id").GetString(),
|
|
id = obj.GetProperty("id").GetString(),
|
|
name = obj.GetProperty("name").GetString(),
|
|
name = obj.GetProperty("name").GetString(),
|
|
@@ -108,10 +108,8 @@ namespace TEAMModelBI.Controllers.BINormal
|
|
}
|
|
}
|
|
catch { }
|
|
catch { }
|
|
|
|
|
|
- if (!string.IsNullOrEmpty($"{joinAreaSchool.id}"))
|
|
|
|
- {
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty($"{joinAreaSchool.id}"))
|
|
joinAreaSchool.assists = await CommonFind.FindSchoolRoles(cosmosClient, joinAreaSchool.id, "assist");
|
|
joinAreaSchool.assists = await CommonFind.FindSchoolRoles(cosmosClient, joinAreaSchool.id, "assist");
|
|
- }
|
|
|
|
|
|
|
|
joinAreaSchools.Add(joinAreaSchool);
|
|
joinAreaSchools.Add(joinAreaSchool);
|
|
}
|
|
}
|