|
@@ -610,12 +610,12 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
string queryWhere = " WHERE 1=1 ";
|
|
|
string queryOption = string.Empty;
|
|
|
//學段
|
|
|
- if (request.TryGetProperty("periodId", out JsonElement periodId) && container == "School")
|
|
|
+ if (request.TryGetProperty("periodId", out JsonElement periodId) && container .Equals("School") )
|
|
|
{
|
|
|
queryWhere += $" AND c.periodId = '{periodId}'";
|
|
|
}
|
|
|
//年級
|
|
|
- if (request.TryGetProperty("gradeId", out JsonElement gradeIds) && gradeIds.GetArrayLength() > 0 && container == "School")
|
|
|
+ if (request.TryGetProperty("gradeId", out JsonElement gradeIds) && gradeIds.GetArrayLength() > 0 && container .Equals("School"))
|
|
|
{
|
|
|
string queryOptionForGrade = string.Empty;
|
|
|
for (int i = 0; i < gradeIds.GetArrayLength(); i++)
|
|
@@ -629,7 +629,7 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
queryWhere += $" AND ( {queryOptionForGrade} )";
|
|
|
}
|
|
|
//科目ID
|
|
|
- if (request.TryGetProperty("subjectId", out JsonElement subjectId) && container == "School")
|
|
|
+ if (request.TryGetProperty("subjectId", out JsonElement subjectId) && container .Equals("School"))
|
|
|
{
|
|
|
queryWhere += $" AND c.subjectId = '{subjectId}'";
|
|
|
}
|
|
@@ -715,7 +715,7 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
if (!request.TryGetProperty("grant_type", out JsonElement grant_type)) return BadRequest();
|
|
|
string partitionid = string.Empty;
|
|
|
string container = string.Empty;
|
|
|
- if (grant_type.ToString() == "school")
|
|
|
+ if (grant_type.ToString().Equals("school"))
|
|
|
{
|
|
|
if (!request.TryGetProperty("school_code", out JsonElement school_code_json))
|
|
|
{
|
|
@@ -737,12 +737,12 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
string queryWhere = " WHERE 1=1 ";
|
|
|
string queryOption = string.Empty;
|
|
|
//學段
|
|
|
- if (request.TryGetProperty("periodId", out JsonElement periodId) && container == "School")
|
|
|
+ if (request.TryGetProperty("periodId", out JsonElement periodId) && container .Equals("School"))
|
|
|
{
|
|
|
queryWhere += $" AND c.periodId = '{periodId}'";
|
|
|
}
|
|
|
//年級
|
|
|
- if (request.TryGetProperty("gradeId", out JsonElement gradeIds) && gradeIds.GetArrayLength() > 0 && container == "School")
|
|
|
+ if (request.TryGetProperty("gradeId", out JsonElement gradeIds) && gradeIds.GetArrayLength() > 0 && container .Equals("School"))
|
|
|
{
|
|
|
string queryOptionForGrade = string.Empty;
|
|
|
for (int i = 0; i < gradeIds.GetArrayLength(); i++)
|
|
@@ -795,7 +795,7 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
string order = "createTime"; //排序項目
|
|
|
if (request.TryGetProperty("order", out JsonElement order_json))
|
|
|
{
|
|
|
- if (order_json.ToString() == "useCount")
|
|
|
+ if (order_json.ToString() .Equals("useCount"))
|
|
|
{
|
|
|
order = order_json.ToString();
|
|
|
}
|
|
@@ -920,13 +920,13 @@ namespace TEAMModelOS.Controllers.Client
|
|
|
string stulist = Convert.ToString(stulist_id);
|
|
|
if(string.IsNullOrWhiteSpace(classId) && string.IsNullOrWhiteSpace(stulist)) return BadRequest();
|
|
|
request.TryGetProperty("school_code", out JsonElement school_code);
|
|
|
- if (grant_type.GetString() == "school" && string.IsNullOrWhiteSpace(Convert.ToString(school_code))) return BadRequest();
|
|
|
+ if (grant_type.GetString() .Equals("school") && string.IsNullOrWhiteSpace(Convert.ToString(school_code))) return BadRequest();
|
|
|
|
|
|
var client = _azureCosmos.GetCosmosClient();
|
|
|
List<object> students = new List<object>();
|
|
|
- string container = (grant_type.GetString() == "school") ? "School" : "Teacher";
|
|
|
+ string container = (grant_type.GetString() .Equals("school")) ? "School" : "Teacher";
|
|
|
//Case 1 取得stulist成員 (有stulist_id則優先取)
|
|
|
- if (grant_type.GetString() == "private" && string.IsNullOrWhiteSpace(stulist) && !string.IsNullOrWhiteSpace(classId)) //若private,且classId不為空,stulist為空,有可能HiTeach無法判別是若classId還是stulist
|
|
|
+ if (grant_type.GetString().Equals("private") && string.IsNullOrWhiteSpace(stulist) && !string.IsNullOrWhiteSpace(classId)) //若private,且classId不為空,stulist為空,有可能HiTeach無法判別是若classId還是stulist
|
|
|
{
|
|
|
stulist = classId;
|
|
|
}
|