|
@@ -4,6 +4,7 @@ using HTEXLib.COMM.Helpers;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Http;
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
+using Microsoft.AspNetCore.SignalR;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
using System.Linq;
|
|
@@ -323,13 +324,14 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
stuListsSql = $" and {andSqlStulist } ";
|
|
|
}
|
|
|
- string joinSubject = "join A2 in c.subjects";
|
|
|
+ //string joinSubject = "join A2 in c.subjects";
|
|
|
string subjectSql = string.Empty;
|
|
|
- if (request.TryGetProperty("subjectId", out JsonElement sub)) {
|
|
|
- subjectSql = $" and A2.id = '{sub})'";
|
|
|
+ if (request.TryGetProperty("subjectId", out JsonElement sub) && type.Equals("Exam"))
|
|
|
+ {
|
|
|
+ subjectSql = $" and c.subjects[0].id = '{sub}'";
|
|
|
}
|
|
|
|
|
|
- List<JsonElement> datas = new List<JsonElement>();
|
|
|
+ List<JsonElement> datas = new List<JsonElement>();
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
//班主任 ,任课教师只需要查询两种校园活动 和班级活动 , 不查询私人教室创建的活动。
|
|
|
if (!string.IsNullOrWhiteSpace(school) && classes.IsNotEmpty())
|
|
@@ -351,12 +353,12 @@ namespace TEAMModelOS.Controllers
|
|
|
if (classes.IsNotEmpty())
|
|
|
{
|
|
|
string queryTeacherClass = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
|
|
|
- $" FROM c {joinSqlClasses} {joinSubject} where {pksql} {stuListsSql} {subjectSql} and (c.status<>404 or IS_DEFINED(c.status) = false ) ";
|
|
|
+ $" FROM c {joinSqlClasses} where {pksql} {stuListsSql} {subjectSql} and (c.status<>404 or IS_DEFINED(c.status) = false ) ";
|
|
|
var resultC = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<JsonElement>(queryTeacherClass, $"{type}-{id}");
|
|
|
datas.AddRange(resultC.list);
|
|
|
|
|
|
string queryTeacherStulist = $" SELECT distinct c.owner,c.sStatus, c.id,c.code, c.classes,c.stuLists,c.subjects,c.progress,c.scope,c.startTime,c.school,c.creatorId,c.name,c.pk ,c.endTime ,c.source,c.type" +
|
|
|
- $" FROM c {joinSqlStulist} {joinSubject} where {pksql} {classesSql} {subjectSql} and (c.status<>404 or IS_DEFINED(c.status) = false ) ";
|
|
|
+ $" FROM c {joinSqlStulist} where {pksql} {classesSql} {subjectSql} and (c.status<>404 or IS_DEFINED(c.status) = false ) ";
|
|
|
var resultD = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<JsonElement>(queryTeacherStulist, $"{type}-{id}");
|
|
|
datas.AddRange(resultD.list);
|
|
|
}
|