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
+