From a4decd9f079e849f0a21602663eca6e6712ad7f0 Mon Sep 17 00:00:00 2001 From: Marvin Date: Wed, 13 Dec 2023 22:26:48 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9MailGroup=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=A0=B9=E6=93=9A=E7=BE=A4=E7=B5=84=E4=BB=A3=E7=A2=BC?= =?UTF-8?q?=E8=AE=80=E5=8F=96=E9=83=B5=E4=BB=B6=E6=B8=85=E5=96=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/BAS/MailGroupsController.cs | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/AMESCoreStudio.WebApi/Controllers/BAS/MailGroupsController.cs b/AMESCoreStudio.WebApi/Controllers/BAS/MailGroupsController.cs index 655d46e6..c7826de1 100644 --- a/AMESCoreStudio.WebApi/Controllers/BAS/MailGroupsController.cs +++ b/AMESCoreStudio.WebApi/Controllers/BAS/MailGroupsController.cs @@ -67,6 +67,47 @@ namespace AMESCoreStudio.WebApi.Controllers.BAS return mailGroup; } + /// + /// 用群组编号获取该Mail群組资料 + /// + /// + /// + // GET: api/MailGroups/5 + [Route("[action]")] + [HttpGet] + public async Task> GetMailList(string id) + { + ResultModel result = new ResultModel(); + var q = from a in _context.MailGroups + join b in _context.MailGroupDetails on a.GroupID equals b.GroupID + join c in _context.UserInfoes on b.UserID equals c.UserID + select new + { + a.GroupNo, + a.GroupID, + b.UserID, + c.UserEMail + }; + + q = q.Where(w => w.GroupNo.Equals(id)); + + //紀錄筆數 + result.DataTotal = q.Count(); + + result.Data = await q.ToListAsync(); + + if (result == null) + { + result.Msg = "查無資料"; + result.Success = false; + return result; + } + + result.Success = true; + result.Msg = "OK"; + return result; + } + /// /// 更新Mail群組资料 ///