51 lines
1.6 KiB
C#
Raw Normal View History

2025-01-13 21:06:59 +08:00
using Microsoft.EntityFrameworkCore;
using YD_XinWei.Api.Context;
using YD_XinWei.Api.Services.Interface;
using YD_XinWei.Api.SmartSportsEntitys;
using YD_XinWei.Commons.Dto.School;
namespace YD_XinWei.Api.Services.Impl
{
public class StudentService : IStudentService
{
public SmartSportsContext _sportsContext;
public StudentService(SmartSportsContext sportsContext)
{
_sportsContext = sportsContext;
}
public async Task<List<ClassListDto>> ClassListbyTeacher(string teacherPhoneNo)
{
2025-01-14 16:11:31 +08:00
//var classList = await (
// from t in _sportsContext.Teacher
// join a in _sportsContext.ClassAssocTeacher on t.Id equals a.TeacherId
// join c in _sportsContext.Class on a.ClassId equals c.Id
// where t.TeacherPhoneNo == teacherPhoneNo
// select new ClassListDto()
// {
// ClassId = c.Id,
// Name = $"{c.GradeName}-{c.ClassName}"
// }).ToListAsync();
2025-01-13 21:06:59 +08:00
2025-01-14 16:11:31 +08:00
//return classList;
return null;
2025-01-13 21:06:59 +08:00
}
public async Task<List<StudentListDto>> StudentListByClassId(int classId)
{
2025-01-14 16:11:31 +08:00
//var students = await _sportsContext.Student.Where(x => x.ClassId == classId).Select(x => new StudentListDto()
//{
// StudentNo = x.StudentNo,
// StudentName = x.StudentName,
// Sex = x.Sex,
// Photo = x.Photo
//}).ToListAsync();
2025-01-13 21:06:59 +08:00
2025-01-14 16:11:31 +08:00
//return students;
return null;
2025-01-13 21:06:59 +08:00
}
}
}