diff --git a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java index 58a1a42..ae7e4a9 100644 --- a/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java +++ b/src/main/java/io/v/nutz/zhgh/lxy/controller/LxyCommon.java @@ -14,6 +14,7 @@ import org.nutz.ioc.loader.annotation.Inject; import org.nutz.ioc.loader.annotation.IocBean; import org.nutz.mvc.annotation.At; import org.nutz.mvc.annotation.Ok; +import org.nutz.mvc.annotation.Param; /** * @Author: 1V @@ -77,7 +78,7 @@ public class LxyCommon { @At @ViReturn - public Object getHdList(Integer year) { + public Object getHdList(@Param(value = "year", required = false) Integer year) { Sql sql = Sqls.create("SELECT id,`name` FROM `lxy_hd` $condition"); Cnd cnd = Cnd.NEW(); if (year != null) { @@ -96,7 +97,7 @@ public class LxyCommon { @At @ViReturn - public Object getNowHdList(Integer year) { + public Object getNowHdList(@Param(value = "year", required = false) Integer year) { Sql sql = Sqls.create("SELECT id,`name` FROM `lxy_hd` $condition"); Cnd cnd = Cnd.NEW(); cnd.and(new org.nutz.dao.util.cri.Static("now() < bmjzsj")); diff --git a/src/main/resources/views/platform/lxy/dialogView.html b/src/main/resources/views/platform/lxy/dialogView.html index 309f088..29c8a90 100644 --- a/src/main/resources/views/platform/lxy/dialogView.html +++ b/src/main/resources/views/platform/lxy/dialogView.html @@ -93,14 +93,20 @@ var now = new Date().getTime() var hdkssj = moment(row.hdkssj.valueOf()) var hdjssj = moment(row.hdjssj.valueOf()) + var bmkssj = moment(row.bmkssj.valueOf()) var bmjzsj = moment(row.bmjzsj.valueOf()) - if (now < bmjzsj) { + if (now < bmkssj) { + return { + class: 'text-info', + name: '报名未开始' + } + } else if (bmkssj <= now && now < bmjzsj) { return { class: 'text-success', name: '活动报名中' } - } else if (bmjzsj < now && now < hdkssj) { + } else if (bmjzsj <= now && now < hdkssj) { return { class: 'text-info', name: '报名已截止' diff --git a/src/main/resources/views/platform/zgfw/lxy/dialogView.html b/src/main/resources/views/platform/zgfw/lxy/dialogView.html index f9f7b69..9d7d179 100644 --- a/src/main/resources/views/platform/zgfw/lxy/dialogView.html +++ b/src/main/resources/views/platform/zgfw/lxy/dialogView.html @@ -99,14 +99,20 @@ var now = new Date().getTime() var hdkssj = moment(row.hdkssj.valueOf()) var hdjssj = moment(row.hdjssj.valueOf()) + var bmkssj = moment(row.bmkssj.valueOf()) var bmjzsj = moment(row.bmjzsj.valueOf()) - if (now < bmjzsj) { + if (now < bmkssj) { + return { + class: 'text-info', + name: '报名未开始' + } + } else if (bmkssj <= now && now < bmjzsj) { return { class: 'text-success', name: '活动报名中' } - } else if (bmjzsj < now && now < hdkssj) { + } else if (bmjzsj <= now && now < hdkssj) { return { class: 'text-info', name: '报名已截止'