diff --git a/BO/Views/cm/cmreg.cshtml b/BO/Views/cm/cmreg.cshtml index d6b5616..1ab0a8d 100644 --- a/BO/Views/cm/cmreg.cshtml +++ b/BO/Views/cm/cmreg.cshtml @@ -247,13 +247,13 @@
@Html.Partial("./Partial/Radio", null, new ViewDataDictionary() { { "valuetext", "1:공개;0:비공개" }, { "checked", Model.CM.isuse }, { "name", "CM.isuse" } })
-
+ @*
@Html.TextBoxFor(m => m.CM.daylectinninglimit, new { @class = "form-control disp-init int text-right", @style = "width: 100px;", @maxlength = "5", @placeholder = "" }) 회차 ※ 0이면 무제한
-
+
*@ @Html.HiddenFor(m => m.intval) diff --git a/Base/Controller/FOCommon.cs b/Base/Controller/FOCommon.cs index 71c9ed5..159ef65 100644 --- a/Base/Controller/FOCommon.cs +++ b/Base/Controller/FOCommon.cs @@ -372,8 +372,8 @@ namespace NP.Base.Controllers } else { - var intval = Dao.Get("cr.lectinnings", new System.Collections.Hashtable() { { "lectno", lectno }, { "isfinishtoday", 1 } }).Count(); - if (intval > 7 && cmi.istatus < 2) + var intval = Dao.Get("cr.lectinnings", new System.Collections.Hashtable() { /*{ "lectno", lectno }*/ { "userno",SUserInfo.UserNo}, { "isfinishtoday", 1 } }).Count(); + if (intval > Convert.ToInt32((GetConfig("inninglimit") ?? "10")) && cmi.istatus < 2) { return JsonBack(new JsonRtn() { code = 1000, obj = -3 }); } diff --git a/Dao/MyBatis/Maps/CM.xml b/Dao/MyBatis/Maps/CM.xml index c66523c..4559466 100644 --- a/Dao/MyBatis/Maps/CM.xml +++ b/Dao/MyBatis/Maps/CM.xml @@ -243,7 +243,7 @@ values (#ismaster#,#cgno#,#pcmno#,#cname#,#kname#,#tmno#,#classno#,#rstime#,#retime#,#sstime#,#setime#,#gstime#,#getime#,#cshape# ,#infee#,#outfee#,#accommofee#,#quota# ,#introhtml#,#targethtml#,#goalhtml#,#contenthtml# - ,#studyplace#,#studytime#,#certcc#,#certgradecc#,#jobcc#,#jobpositiongrade#,#difficulty#,#isrefund#,#isuse#,0,#isseq#,#fgnocm#,#typeman#,#typeedu#,#typegrade#,#typejob#,#iscertificate#,#ischkatt#,#isaccommodation#,#daylectinninglimit#,); + ,#studyplace#,#studytime#,#certcc#,#certgradecc#,#jobcc#,#jobpositiongrade#,#difficulty#,#isrefund#,#isuse#,0,#isseq#,#fgnocm#,#typeman#,#typeedu#,#typegrade#,#typejob#,#iscertificate#,#ischkatt#,#isaccommodation#,10,); SELECT LAST_INSERT_ID() @@ -285,7 +285,7 @@ ,ischkatt =#ischkatt# ,studydays =#studydays# ,isaccommodation =#isaccommodation# - ,daylectinninglimit =#daylectinninglimit# + where cmno=#cmno# diff --git a/Dao/MyBatis/Maps/CRoom.xml b/Dao/MyBatis/Maps/CRoom.xml index 6ec8fd5..23839de 100644 --- a/Dao/MyBatis/Maps/CRoom.xml +++ b/Dao/MyBatis/Maps/CRoom.xml @@ -195,10 +195,12 @@ update lectinning a diff --git a/FO/Controllers/CDMSController.cs b/FO/Controllers/CDMSController.cs index 905645b..73b6343 100644 --- a/FO/Controllers/CDMSController.cs +++ b/FO/Controllers/CDMSController.cs @@ -85,16 +85,18 @@ namespace NP.FO.Controllers //출석 인증 시만 보이게 제한 처리 (intval 회차, intval2 출석인증제외 회원, intval3 출석인증제외 강좌) if (data != null && (data.intval == 1 || data.intval2 == 1 || data.intval3 == 1)) { - var todayLectinningCount = Dao.Get("cr.lectinnings", new Hashtable() { { "lectno", vm.lectno }, { "isfinishtoday", 1 } }).Count(); + vm.todayLectinningCount = Dao.Get("cr.lectinnings", new Hashtable() {/* { "lectno", vm.lectno }*/{ "userno", SUserInfo.UserNo }, { "isfinishtoday", 1 } }).Count(); + vm.daylectinninglimit = Convert.ToInt32((GetConfig("inninglimit") ?? "10")); var lectInnings = Dao.Get("cr.cminnings", new Hashtable() { { "lectno", vm.lectno }, { "userno", SUserInfo.UserNo } }); foreach (var item in lectInnings) { - item.daylectinninglimit = item.daylectinninglimit == 0 ? 9999 : item.daylectinninglimit; + //item.daylectinninglimit = item.daylectinninglimit == 0 ? 9999 : item.daylectinninglimit; + item.daylectinninglimit = vm.daylectinninglimit; } var lectInning = lectInnings.Where(w => w.cmino == vm.cmino).FirstOrDefault(); //1일 신규 동영상 강의를 10차시로 제한 - if (todayLectinningCount < lectInning.daylectinninglimit || lectInning.istatus == 2) + if (vm.todayLectinningCount < lectInning.daylectinninglimit || lectInning.istatus == 2) { //이어보기를 위해 페이지관리 //vm.pseq = vm.pseq < 1 ? 1 : vm.pseq; diff --git a/FO/Controllers/CRoomController.cs b/FO/Controllers/CRoomController.cs index 10f9e08..7b8c86c 100644 --- a/FO/Controllers/CRoomController.cs +++ b/FO/Controllers/CRoomController.cs @@ -37,13 +37,15 @@ namespace NP.FO.Controllers } vm.Datas = Dao.Get("cr.main.boardalarm", new System.Collections.Hashtable() { { "bmnos", bmnos != null ? bmnos.Substring(1) : bmnos},{ "lect", vm.croomlectno },{ "cmno", vm.croomcmno }, { "lectno", vm.croomlectno }, { "userno", SUserInfo.UserNo } }); vm.LectInnings = Dao.Get("cr.cminnings", new System.Collections.Hashtable() { { "lectno", vm.croomlectno },{ "userno",SUserInfo.UserNo}, { "notstudy" + (Request.IsLocal ? "x" : ""), 1 },{ "limit", 6} }); + vm.intval2 = Convert.ToInt32((GetConfig("inninglimit") ?? "10")); foreach (var lectInning in vm.LectInnings) { - lectInning.daylectinninglimit = lectInning.daylectinninglimit == 0 ? 9999 : lectInning.daylectinninglimit; + //lectInning.daylectinninglimit = lectInning.daylectinninglimit == 0 ? 9999 : lectInning.daylectinninglimit; + lectInning.daylectinninglimit = vm.intval2; } if (vm.LectInnings.Count() > 0 && !string.IsNullOrEmpty(vm.LectInnings.FirstOrDefault().existslectinning) ) { - vm.intval = Dao.Get("cr.lectinnings", new System.Collections.Hashtable() { { "lectno", vm.croomlectno }, { "isfinishtoday", 1 } }).Count(); + vm.intval = Dao.Get("cr.lectinnings", new System.Collections.Hashtable() { /*{ "lectno", vm.croomlectno }*/ {"userno",SUserInfo.UserNo }, { "isfinishtoday", 1 } }).Count(); } return CView(); } @@ -58,14 +60,16 @@ namespace NP.FO.Controllers public ActionResult Innings() { vm.LectInnings = Dao.Get("cr.cminnings", new System.Collections.Hashtable() { { "lectno", vm.croomlectno }, { "userno", SUserInfo.UserNo } }); + vm.intval2 = Convert.ToInt32((GetConfig("inninglimit") ?? "10")); foreach (var lectInning in vm.LectInnings) { - lectInning.daylectinninglimit = lectInning.daylectinninglimit == 0 ? 9999 : lectInning.daylectinninglimit; + //lectInning.daylectinninglimit = lectInning.daylectinninglimit == 0 ? 9999 : lectInning.daylectinninglimit; + lectInning.daylectinninglimit = vm.intval2; } ViewBag.Mobile = Dao.Get("users.users", new System.Collections.Hashtable() { { "userno", SUserInfo.UserNo } }).FirstOrDefault().mobile; if (!string.IsNullOrEmpty(vm.LectInnings.FirstOrDefault().existslectinning) && vm.LectInnings.Count() > 0) { - vm.intval = Dao.Get("cr.lectinnings", new System.Collections.Hashtable() { { "lectno", vm.croomlectno }, { "isfinishtoday", 1 } }).Count(); + vm.intval = Dao.Get("cr.lectinnings", new System.Collections.Hashtable() { /*{ "lectno", vm.croomlectno }*/ {"userno",SUserInfo.UserNo }, { "isfinishtoday", 1 } }).Count(); } return CView(); } diff --git a/FO/Views/CRoom/Index.cshtml b/FO/Views/CRoom/Index.cshtml index 0e4f773..a302846 100644 --- a/FO/Views/CRoom/Index.cshtml +++ b/FO/Views/CRoom/Index.cshtml @@ -101,6 +101,7 @@
+
오늘의 학습회차(@Model.intval/@Model.intval2)
금주의 학습 수강 중인 강의 모두 보기
diff --git a/FO/Views/CRoom/Innings.cshtml b/FO/Views/CRoom/Innings.cshtml index 85d4d44..1458977 100644 --- a/FO/Views/CRoom/Innings.cshtml +++ b/FO/Views/CRoom/Innings.cshtml @@ -5,6 +5,8 @@ @**@ +

오늘의 학습회차(@Model.intval/@Model.intval2)

+
diff --git a/FO/Web.config b/FO/Web.config index 021229f..09012df 100644 --- a/FO/Web.config +++ b/FO/Web.config @@ -48,6 +48,7 @@ + diff --git a/Model/VMCRoom.cs b/Model/VMCRoom.cs index 1f8ecf6..272305b 100644 --- a/Model/VMCRoom.cs +++ b/Model/VMCRoom.cs @@ -60,5 +60,7 @@ namespace NP.Model public IList Lects { get; set; } public IList Completions { get; set; } public Data ErrLi { get; set; } + public int todayLectinningCount { get; set; } + public int daylectinninglimit { get; set; } } }