zhouj1203@hotmail.com hace 1 año
padre
commit
e34ce5e94c

+ 16 - 0
TEAMModelOS.SDK/Models/Service/StudentService.cs

@@ -234,6 +234,22 @@ namespace TEAMModelOS.SDK
                     datas.AddRange(resultSchool.list);
                     datas.AddRange(resultSchool.list);
                 }
                 }
             }
             }
+            if (types.IsEmpty() || types.Contains("Study"))
+            {
+
+                StringBuilder SQL = new StringBuilder($"select {filed} from c  where c.pk='Study' {groupListSQL} and c.startTime>={stime} and c.startTime <= {etime} ");
+                //获取学校发布的研修活动
+                if (userScope.Equals(Constant.ScopeStudent) && !string.IsNullOrWhiteSpace(school))
+                {
+                    var resultSchool = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL}  and c.owner='school' ", $"Study-{school}");
+                    datas.AddRange(resultSchool.list);
+                }
+               /* //获取教师发布的活动(个人名单,学校名单)
+                {
+                    var resultTeacher = await _azureCosmos.GetCosmosClient().GetContainer(Constant.TEAMModelOS, Constant.Common).GetList<StudentActivity>($"{SQL.ToString()}  and c.owner='teacher' ");
+                    datas.AddRange(resultTeacher.list);
+                }*/
+            }
             //作答 记录recordUrl  taskStatus
             //作答 记录recordUrl  taskStatus
             return datas;
             return datas;
         }
         }

+ 2 - 2
TEAMModelOS/Controllers/Student/StudentCommonController.cs

@@ -85,8 +85,8 @@ namespace TEAMModelOS.Controllers
                 types= _types.ToObject<List<string>>();
                 types= _types.ToObject<List<string>>();
             }
             }
             HttpContext?.Items.TryGetValue("Scope", out  _scope);
             HttpContext?.Items.TryGetValue("Scope", out  _scope);
-            List<StudentActivity> activities =  await  StudentService.FindActivity(request, id, $"{_scope}", groupListIds, subjects, school, types, _azureCosmos);
-            return Ok(new { code =200, activities ,serverTime=DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()});
+            List<StudentActivity> datas =  await  StudentService.FindActivity(request, id, $"{_scope}", groupListIds, subjects, school, types, _azureCosmos);
+            return Ok(new { code =200, datas, serverTime=DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()});
         }
         }
 
 
         /// <summary>
         /// <summary>