jiabanModel.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. //加班
  3. class flow_jiabanClassModel extends flowModel
  4. {
  5. public function flowrsreplace($rs, $lx=0)
  6. {
  7. $rs['modenum'] = $this->modenum;
  8. $type = arrvalue($rs,'jiatype','0');
  9. $types = array('调休','加班费');
  10. $rs['jiatype'] = $types[$type];
  11. $dakatime = '未打卡';
  12. //详情时读取前后2小时打卡记录
  13. if($lx==1){
  14. $stime = date('Y-m-d H:i:s', strtotime($rs['stime'])-3600*2);
  15. $etime = date('Y-m-d H:i:s', strtotime($rs['etime'])+3600*2);
  16. $kqdkjl = m('kqdkjl')->getall("`uid`='".$rs['uid']."' and `dkdt`>='$stime' and `dkdt`<='$etime'",'dkdt','`dkdt` desc');
  17. if($kqdkjl)$dakatime='';
  18. foreach($kqdkjl as $k=>$rs1){
  19. if($k>0)$dakatime.=',&nbsp;';
  20. $dakatime.=''.$rs1['dkdt'].'';
  21. }
  22. }
  23. if($type==1)$rs['jiatype'].=''.$rs['jiafee'].'元';
  24. if($type=='0')$rs['jiafee'] = '';
  25. $rs['dakatime'] = $dakatime;
  26. return $rs;
  27. }
  28. protected function flowgetfields($lx)
  29. {
  30. $arr['dakatime'] = '此时间段打卡';
  31. return $arr;
  32. }
  33. protected function flowbillwhere($uid, $lx)
  34. {
  35. $month = $this->rock->post('month');
  36. $where = '';
  37. if($month!=''){
  38. $where.=" and `stime` like '$month%'";
  39. }
  40. return array(
  41. 'where' => $where
  42. );
  43. }
  44. protected function flowcheckfinsh($zt)
  45. {
  46. if($zt==1)m('flow:leave')->updateenddt();
  47. }
  48. }
粤ICP备19079148号