학습 완료 회차 일일 최대 수료 회차 제한 조건 안 타게 수정

This commit is contained in:
lch 2021-06-30 04:41:28 +00:00
parent 2ae842a180
commit d7e7d6bef1
2 changed files with 6 additions and 3 deletions

View File

@ -196,7 +196,8 @@
from lectinning a
where a.lectno=#lectno#
<isNotNull property="isfinishtoday">
and (a.istatus=2 and a.finishtime is not null and date_format(a.finishtime, '%y%m%d')=date_format(now(), '%y%m%d'))</isNotNull>
and (a.istatus=2 and a.finishtime is not null and date_format(a.finishtime, '%y%m%d')=date_format(now(), '%y%m%d'))
</isNotNull>
</select>
<insert id="cr.lectinningpage.in" parameterClass="lectinningpage">
update lectinning a

View File

@ -83,9 +83,11 @@ namespace NP.FO.Controllers
//출석 인증 시만 보이게 제한 처리 (intval 회차, intval2 출석인증제외 회원, intval3 출석인증제외 강좌)
if (data != null && (data.intval == 1 || data.intval2 == 1 || data.intval3 == 1))
{
var todayLectinningCount = Dao.Get<LectInning>("cr.lectinnings", new System.Collections.Hashtable() { { "lectno", vm.lectno }, { "isfinishtoday", 1 } }).Count();
var lectInnings = Dao.Get<LectInning>("cr.lectinnings", new System.Collections.Hashtable() { { "lectno", vm.lectno }, { "isfinishtoday", 1 } });
var todayLectinningCount = lectInnings.Count();
var istatus = lectInnings.Where(w => w.cmino == vm.cmino && w.istatus == 2).FirstOrDefault() != null ? 2 : 0;
//1일 신규 동영상 강의를 8차시로 제한
if (todayLectinningCount < 8)
if (todayLectinningCount < 8 || istatus == 2)
{
//이어보기를 위해 페이지관리
//vm.pseq = vm.pseq < 1 ? 1 : vm.pseq;