From 191daf3282fa8bba2472f36bcf3873d8f634e978 Mon Sep 17 00:00:00 2001 From: lch Date: Mon, 7 Jun 2021 02:06:55 +0000 Subject: [PATCH] =?UTF-8?q?=EA=B5=90=EC=9C=A1=EC=83=9D=20=EA=B0=9C?= =?UTF-8?q?=EB=B3=84=EB=93=B1=EB=A1=9D=20=ED=95=99=EC=8A=B5=EC=8B=9C?= =?UTF-8?q?=EA=B0=84=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BO/Views/croom/lectreg.cshtml | 8 +------- Base/Controller/ACommonCRoom.cs | 6 +++--- Dao/CommonDao.cs | 7 ++++++- Dao/MyBatis/Maps/Pay.xml | 12 ++++++++++++ 4 files changed, 22 insertions(+), 11 deletions(-) diff --git a/BO/Views/croom/lectreg.cshtml b/BO/Views/croom/lectreg.cshtml index 9a4f769..54e4b6e 100644 --- a/BO/Views/croom/lectreg.cshtml +++ b/BO/Views/croom/lectreg.cshtml @@ -358,13 +358,7 @@ } } function cbsave() { - if (capResult.obj == -1) { - msg("이미 등록된 이메일입니다(ID)"); - } else if (capResult.obj == -2) { - msg("이미 등록된 이메일입니다(Email)"); - } else if (capResult.obj == -3) { - msg("회원등록이 실패하였습니다."); - } else if (capResult.obj == -4) { + if (capResult.obj == -4) { msg("강좌에 해당 회원이 이미 수강중입니다."); } else if (capResult.code == 1000) { msg2("저장되었습니다.", 10, null, null, true); diff --git a/Base/Controller/ACommonCRoom.cs b/Base/Controller/ACommonCRoom.cs index 5f508a5..6b4e998 100644 --- a/Base/Controller/ACommonCRoom.cs +++ b/Base/Controller/ACommonCRoom.cs @@ -93,8 +93,8 @@ namespace NP.Base.Controllers pplog.uno = SUserInfo.UserNo; pplog.uip = GetUserIP(); pplog.isready = cm.applicableCM == "정상접수" ? 0 : 1; - pplog.cgcode = cm.pcgcode; - if (pplog.cgcode != "1") + pplog.cgcode = cm.pcgcode == "1" ? "0" : "1"; + if (pplog.cgcode == "1") { pplog.cgno = cm.cgno; } @@ -195,7 +195,7 @@ namespace NP.Base.Controllers { return JsonOK(-4); } - return JsonOK(Dao.SavePay(pay, true)); + return JsonOK(Dao.SavePay(pay, true, true)); } [HttpPost] public JsonResult LectBatch(String datas) diff --git a/Dao/CommonDao.cs b/Dao/CommonDao.cs index a96c1c8..8415930 100644 --- a/Dao/CommonDao.cs +++ b/Dao/CommonDao.cs @@ -312,7 +312,7 @@ namespace NP.Dao } return rtn; } - public int SavePay(Pay p, bool inlect) + public int SavePay(Pay p, bool inlect, bool inlectsedate = false) { Trans(); try @@ -328,6 +328,11 @@ namespace NP.Dao { //수강데이터 base.Insert("pay.lect.in", pi); + if (inlectsedate) + { + //온라인강좌 수강시작일, 수강종료일 수정 + base.Save("pay.lect.sedate.save", p); + } } } Commit(); diff --git a/Dao/MyBatis/Maps/Pay.xml b/Dao/MyBatis/Maps/Pay.xml index 94a3dac..ab6a4a0 100644 --- a/Dao/MyBatis/Maps/Pay.xml +++ b/Dao/MyBatis/Maps/Pay.xml @@ -43,6 +43,18 @@ values(#itemno#,#payno#,#pino#,#userno#,#status#,#isready#,null,null,0,0,#ispc#,#pcno#,#isjoin#,null,0,#cmisno#,); SELECT LAST_INSERT_ID() + + update lect a + inner join cm b on a.cmno = b.cmno + inner join pay c on a.payno = c.payno + set + a.sdate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape <> 1 then date_format(c.payoktime,'%Y-%m-%d 00:00:00') + else b.sstime end, + a.edate = case when date_format(b.retime,'%Y-%m-%d')='2099-12-31' and b.cshape <> 1 then date_format(date_add(c.payoktime,interval b.studydays day),'%Y-%m-%d 23:59:59') + else b.setime end + ,a.udt=now(),a.uno=#uno#,a.uip=#uip# + where a.payno = #payno# and c.pstatus = 1 +