From b59ae90027ad774739451d96450f605696637f94 Mon Sep 17 00:00:00 2001 From: hyunho Date: Tue, 26 Jan 2021 08:26:54 +0000 Subject: [PATCH] --- Dao/MyBatis/Maps/CRoom.xml | 14 ++++++++++---- Dao/MyBatis/Maps/Pay.xml | 2 ++ FO/Controllers/CRoomController.cs | 2 ++ FO/Controllers/MyController.cs | 2 +- FO/Views/CRoom/Estimation.cshtml | 3 ++- FO/Views/CRoom/Research.cshtml | 13 +++++++++++-- FO/Views/My/Ready.cshtml | 2 +- Model/Pay.cs | 2 ++ 8 files changed, 31 insertions(+), 9 deletions(-) diff --git a/Dao/MyBatis/Maps/CRoom.xml b/Dao/MyBatis/Maps/CRoom.xml index 80053a8..51bd798 100644 --- a/Dao/MyBatis/Maps/CRoom.xml +++ b/Dao/MyBatis/Maps/CRoom.xml @@ -434,8 +434,10 @@ union all select b.extype dtype ,b.exname strval,b.exno intval10 - ,case when a2.sstime < now() and a2.setime > now() then a.attrate else -1 end intval,b.econdition intval2 - ,case when c.eend is null then 0 else 1 end intval3,null intval4 + + ,case when a.sdate < now() and a.edate > now() then a.attrate else -1 end intval,b.econdition intval2 + ,case when c.eend is null then 0 else 1 end intval3 + ,null intval4 ,row_number() over (partition by b.extype order by b.extype, b.cdt) rno from lect a inner join cm a2 on a2.cmno=a.cmno @@ -447,7 +449,10 @@ union all select 2 dtype ,b.sdname strval,b.sdno intval10 - ,case when a2.sstime < now() and a2.setime > now() then a.attrate else -1 end intval,b.sdcondition intval2,case when c.submittime is null then 0 else 1 end intval3,case when c.checktime is null then 0 else 1 end intval4 + + ,case when a.sdate < now() and a.edate > now() then a.attrate else -1 end intval,b.sdcondition intval2 + ,case when c.submittime is null then 0 else 1 end intval3 + ,case when c.checktime is null then 0 else 1 end intval4 ,row_number() over (order by b.cdt) rno from lect a inner join cm a2 on a2.cmno=a.cmno @@ -459,7 +464,8 @@ union all select 3 dtype ,b.sdname strval,b.sdno intval10 - ,case when a2.sstime < now() and a2.setime > now() then a.attrate else -1 end intval,b.sdcondition intval2 + + ,case when a.sdate < now() and a.edate > now() then a.attrate else -1 end intval,b.sdcondition intval2 ,case when count(d.bno) > 0 then 1 else 0 end intval3 ,case when c.checktime is null then 0 else 1 end intval4 ,row_number() over (order by b.cdt) rno diff --git a/Dao/MyBatis/Maps/Pay.xml b/Dao/MyBatis/Maps/Pay.xml index 9e07d77..4dc20b4 100644 --- a/Dao/MyBatis/Maps/Pay.xml +++ b/Dao/MyBatis/Maps/Pay.xml @@ -506,6 +506,8 @@ ,case when max(e.rfdno) > 0 then 1 else 0 end rfdstatus ,lect.cmisno ,cmis.estart cmiestart,cmis.eend cmieend + ,case when lect.sdate is null then c.sstime else lect.sdate end as sdate + ,case when lect.edate is null then c.setime else lect.edate end as edate from pay a inner join payitem b on b.payno=a.payno and b.ptype in (0,1,4) and b.pstatus in (1,21,22,51,55) inner join cm c on c.cmno=b.itemno and c.rstime < now() and c.retime > now() diff --git a/FO/Controllers/CRoomController.cs b/FO/Controllers/CRoomController.cs index 6753156..2ec5b42 100644 --- a/FO/Controllers/CRoomController.cs +++ b/FO/Controllers/CRoomController.cs @@ -63,6 +63,8 @@ namespace NP.FO.Controllers public ActionResult Research() { vm.CMRSes = Dao.Get("cr.mycmrs", new System.Collections.Hashtable() { { "lectno", vm.croomlectno },{ "userno",SUserInfo.UserNo} }); + Lect lect = Dao.Get("cr.checklectdate", new System.Collections.Hashtable() { { "lectno", vm.croomlectno } }).First(); + ViewBag.isres = DateTime.Now <= lect.edate? 1 : -1; return CView(); } public ActionResult Grade() diff --git a/FO/Controllers/MyController.cs b/FO/Controllers/MyController.cs index 852353c..f7c1104 100644 --- a/FO/Controllers/MyController.cs +++ b/FO/Controllers/MyController.cs @@ -34,7 +34,7 @@ namespace NP.FO.Controllers ViewBag.mpgContclass = ""; vm.Assign = Dao.Get("users.users.assign", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault(); //신청중,수강중,나의할일,나의알림 - vm.Datas = Dao.Get("lect.mydata", SUserInfo.UserNo); + vm.Datas = Dao.Get("lect.mydata", SUserInfo.UserNo).Where(x => x.time2 >= DateTime.Now).ToList(); //수강종료일이 지난건 노출하지않도록 var sd = Request.Url.Host.Split('.')[0]; if (GetConfig("isdevtest") != "" && Request.Url.Host != "ynicte.nptc.kr" && Request.Url.Host != "222.122.63.91" && MainSubDomain.ToUpper() != sd.ToUpper()) { diff --git a/FO/Views/CRoom/Estimation.cshtml b/FO/Views/CRoom/Estimation.cshtml index 8322a4e..42bfa04 100644 --- a/FO/Views/CRoom/Estimation.cshtml +++ b/FO/Views/CRoom/Estimation.cshtml @@ -22,7 +22,8 @@
@(d.dtype == 0 ? "진행평가":d.dtype==1?"최종평가":d.dtype == 2?"과제":d.dtype==3?"토론":"") @d.strval

참여조건 : 진도율 @(d.intval2)% 이상

- =d.intval2?"02":"01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >=d.intval2 ? "[참여가능]" : "[참여불가]") + =d.intval2?"02":"01")">@(d.intval4 == 1 ? "[평가완료]" : d.intval3 == 1 ? "[참여완료]" : d.intval3 == 0 && d.intval >=d.intval2 ? "[참여가능]" : "[참여불가]") } @if (Model.Datas.Count() < 1) diff --git a/FO/Views/CRoom/Research.cshtml b/FO/Views/CRoom/Research.cshtml index ca0f001..74f5a5b 100644 --- a/FO/Views/CRoom/Research.cshtml +++ b/FO/Views/CRoom/Research.cshtml @@ -13,9 +13,18 @@
@d.rstypename
-

참여조건 : 진도율 @(d.rscondition)% 이상

+

참여조건 : 진도율 @(d.rscondition)% 이상 , 수강 기간내

- @(d.rscondition > d.attrate ? "참여불가" : d.isrsok == 1 ? "참여완료" : "참여") + + @if (ViewBag.isres > 0) + { + @(d.rscondition > d.attrate ? "참여불가" : d.isrsok == 1 ? "참여완료" : "참여") + } + else + { + 참여불가 + } + } } diff --git a/FO/Views/My/Ready.cshtml b/FO/Views/My/Ready.cshtml index 076eab6..9662dc0 100644 --- a/FO/Views/My/Ready.cshtml +++ b/FO/Views/My/Ready.cshtml @@ -40,7 +40,7 @@
@(d.pstatus == 55 ? "승인대기" : d.pstatus == 51 ? "심사중" : d.pstatus == 21 ? "결제대기" : d.pstatus == 22 ? "입금대기" : d.pstatus == 1 && d.rfdstatus > 0 ? "환불요청" : d.pstatus == 1 ? "결제완료" : d.rstatus == 1 ? "부분환불" : d.rstatus == 2 ? "전액환불" : "-")
- 수강기간 : @d.sstime.ToString("yy-MM-dd") ~ @d.setime.ToString("yy-MM-dd") + 수강기간 : @d.sdate.ToString("yy-MM-dd") ~ @d.edate.ToString("yy-MM-dd") @if (d.cshape == 2) { @:| 집체교육기간 : @(d.cmisno == null ? "미정" : ("[" + d.studyplacename + "] " + string.Format("{0}", d.cmiestart.ToString("yy-MM-dd")))) diff --git a/Model/Pay.cs b/Model/Pay.cs index 2f93ca3..bbb6eda 100644 --- a/Model/Pay.cs +++ b/Model/Pay.cs @@ -488,6 +488,8 @@ namespace NP.Model public String studyplacename { get; set; } public DateTime cmiestart { get; set; } public DateTime cmieend { get; set; } + public DateTime sdate { get; set; } + public DateTime edate { get; set; } } ///