一,是否参会
SQL查询语句
--查询出带某用户id=2 的会议信息
select * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT(canyuze,liexize,zhuchiren))
select t1.*,
IFNULL(f.result,-1) result from
(select * from t_oa_meeting_info where FIND_IN_SET(2,CONCAT(canyuze,liexize,zhuchiren)) and state = 4) t1
left join t_oa_meeting_feedback f on t1.id = f.meetingId and f.personId = 2
ORDER BY result
注意:不管会议是否得到反馈,都要查询出来,所以采用外连接,会议信息表为主
前台编码
引入相关文件
test.js文件
//提示:模块也可以依赖其它模块,如:layui.define('layer', callback);
layui.define(function(exports){
var obj = {
hello: function(str){
alert('Hello '+ (str||'test'));
},
toDate:function(date,pattern){
return fmtDate(date,pattern);
}
};
//输出test接口
//test.hello('zs');
exports('test', obj);
});
//给Date类添加了一个新的实例方法format
Date.prototype.format = function (fmt) {
//debugger;
var o = {
"M+": this.getMonth() + 1, //月份
"d+": this.getDate(), //日
"h+": this.getHours(), //小时
"m+": this.getMinutes(), //分
"s+": this.getSeconds(), //秒
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
"S": this.getMilliseconds() //毫秒
};
if (/(y+)/.test(fmt))
fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt))
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
};
function fmtDate(date, pattern) {
var ts = date.getTime();
var d = new Date(ts).format("yyyy-MM-dd hh:mm:ss");
if (pattern) {
d = new Date(ts).format(pattern);
}
return d.toLocaleString();
};
config.js文件
layui.config({
base: 'static/js/layui/modules/' //假设这是test.js所在的目录
}).extend({ //设定模块别名
test: 'test' //如果test.js是在根目录,也可以不用设定别名
});
jsp界面:
在jsp文件中引入config.js文件,目的就是为了可以调用test方法,在公共界面里加上一条
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!-- 存放layui拓展模块的配置文件 -->
<script src="${pageContext.request.contextPath}/static/js/layui/config.js"></script>
然后再jsp界面中引入到公共界面就可以了
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="${pageContext.request.contextPath }/static/js/meeting/addFeedBack.js"></script>
</head>
<style>
body{
margin:5px;
}
</style>
<body>
<div style="padding:10px;">
<form class="layui-form layui-form-pane" lay-filter="back">
<!-- <div class="layui-form-item">
<button type="submit" class="layui-btn" lay-submit="" lay-filter="meeting">立即提交</button>
<button id="reset" type="reset" class="layui-