|
@@ -1529,13 +1529,13 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
// cosmosClient = _azureCosmos.GetCosmosClient(name: BIConst.Global);
|
|
|
|
|
|
List<YearCnt> yearCnts = new(); //当前的课例,活动,互动统计
|
|
|
-
|
|
|
+ List<string> schoolIds = new();
|
|
|
string strSql = "SELECT value(count(c.id)) FROM c where c.pk='LessonRecord'";
|
|
|
string scSql = null;
|
|
|
if (!string.IsNullOrEmpty($"{tmdId}") && string.IsNullOrEmpty($"{schooId}"))
|
|
|
{
|
|
|
//List<string> schoolIds = await CommonFind.FindSchoolIds(cosmosClient, $"{tmdId}");
|
|
|
- List<string> schoolIds = new();
|
|
|
+
|
|
|
if (!string.IsNullOrEmpty($"{tmdId}"))
|
|
|
{
|
|
|
switch ($"{role}")
|
|
@@ -1548,19 +1548,21 @@ namespace TEAMModelBI.Controllers.BISchool
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
- schoolIds = await CommonFind.GetValueSingle(cosmosClient, "School", "select value(c.id) from c", "Base");
|
|
|
-
|
|
|
- if (schoolIds.Count == 0) return Ok(new { state = RespondCode.Ok, yearCnts, });
|
|
|
- scSql = BICommonWay.ManyScSql("c.school", schoolIds);
|
|
|
}
|
|
|
-
|
|
|
- if (!string.IsNullOrEmpty($"{schooId}") && string.IsNullOrEmpty($"{tmdId}"))
|
|
|
+ else if (!string.IsNullOrEmpty($"{schooId}") && string.IsNullOrEmpty($"{tmdId}"))
|
|
|
scSql = $"c.school = '{schooId}'";
|
|
|
+ else
|
|
|
+ {
|
|
|
+ schoolIds = await CommonFind.GetValueSingle(cosmosClient, "School", "select value(c.id) from c", "Base");
|
|
|
|
|
|
- if ((string.IsNullOrEmpty($"{tmdId}") && string.IsNullOrEmpty($"{schooId}")) || (!string.IsNullOrEmpty($"{tmdId}") && !string.IsNullOrEmpty($"{schooId}")))
|
|
|
- return Ok(new { state = RespondCode.ParamsError, msg = "参数错误" });
|
|
|
+ if (schoolIds.Count == 0)
|
|
|
+ return Ok(new { state = RespondCode.Ok, yearCnts, });
|
|
|
+ else
|
|
|
+ scSql = BICommonWay.ManyScSql("c.school", schoolIds);
|
|
|
+ }
|
|
|
|
|
|
+ //if ((string.IsNullOrEmpty($"{tmdId}") && string.IsNullOrEmpty($"{schooId}")) || (!string.IsNullOrEmpty($"{tmdId}") && !string.IsNullOrEmpty($"{schooId}")))
|
|
|
+
|
|
|
List<MonthStartEnd> mthStartEnds = await TimeHelper.GetYearSataMthCtMth(DateTimeOffset.UtcNow);
|
|
|
if (mthStartEnds.Count > 0)
|
|
|
{
|