PHP考勤统计问题 你自己不想动手写吧!哪有一条sql语句输出这么多要求的 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 要是我的话,我觉得这数据库设计的都不好,你上下班这个逻辑很简单上班8:30,下班17:40,这样的话,我就不会把上下班分成两个数据,我会这样设计考勤表 attendanceattendance_start attendance_end字段 设置默认值 0attendance_type 设置默认值 0(未迟到早退)ps:做个判读迟到早退的逻辑再入数据库attendance_id |attendance_date |attendance_start |attendance_end |attendance_type (迟到为1,早退为2,迟到&再退3)1 2014-10-10 8:27:23 17:58:22 02 2014-10-11 8:27:23 17:58:22 0这样的话1)查询上班未打卡日期select * from attendance where attendance_start=02)查询下班未打卡日期select * from attendance where attendance_end=03)迟到&早退几分钟select * from attendance where attendance_type=1select * from attendance where attendance_type=2select * from attendance where attendance_type=3那8:30 17:40 与 考勤时间计算 就能得到迟到&早退几分钟 zend的waiting for xdebug session 请问下, php里echo里的row,好像没办法写字段名? PHP过滤代码,正则表达式过滤掉调用类的方法 php关联QQ号码,新浪号码做做登录 正则表达式N个问题 APC配置问题 session 问题 php载入外部扩充模组出错. 问一sql语句,help 一个问题 PHP系统公告-发送通知给每个人 为啥在连接数据库的时候要销毁这么多呢
你上下班这个逻辑很简单
上班8:30,下班17:40,这样的话,我就不会把上下班分成两个数据,
我会这样设计考勤表 attendance
attendance_start attendance_end字段 设置默认值 0
attendance_type 设置默认值 0(未迟到早退)
ps:做个判读迟到早退的逻辑再入数据库attendance_id |attendance_date |attendance_start |attendance_end |attendance_type (迟到为1,早退为2,迟到&再退3)
1 2014-10-10 8:27:23 17:58:22 0
2 2014-10-11 8:27:23 17:58:22 0
这样的话
1)查询上班未打卡日期
select * from attendance where attendance_start=0
2)查询下班未打卡日期
select * from attendance where attendance_end=0
3)迟到&早退几分钟
select * from attendance where attendance_type=1
select * from attendance where attendance_type=2
select * from attendance where attendance_type=3
那8:30 17:40 与 考勤时间计算 就能得到迟到&早退几分钟