mode_jiabanAction.php 769 B

12345678910111213141516171819202122232425
  1. <?php
  2. class mode_jiabanClassAction extends inputAction{
  3. public function totalAjax()
  4. {
  5. $start = $this->post('stime');
  6. $end = $this->post('etime');
  7. $uid = $this->post('uid', $this->adminid);
  8. $jiatype= (int)$this->post('jiatype');
  9. $date = c('date', true);
  10. $sj = $date->datediff('H', $start, $end);
  11. //$sj = m('kaoqin')->getsbtime($uid,$start, $end); //如果想用考勤规则来就去掉前面注释
  12. $jiafee = 0;
  13. if($jiatype==1)$jiafee = m('kaoqin')->jiafee($this->adminid, $sj, $start);
  14. $this->returnjson(array($sj, '', $jiafee));
  15. }
  16. protected function savebefore($table, $arr, $id, $addbo){
  17. $msg = m('kaoqin')->leavepan($arr['uid'], '', $arr['stime'], $arr['etime'], 0, $id,'加班');
  18. return $msg;
  19. }
  20. }
粤ICP备19079148号