hrAction.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. class hrClassAction extends runtAction
  3. {
  4. /*
  5. * 员工合同到期提醒/人事每天调动运行
  6. */
  7. public function httodoAction()
  8. {
  9. m('hr')->hrrun(); //人事每天调动/离职等运行
  10. //员工合同到期提醒
  11. $flow = m('flow')->initflow('userract');
  12. $flow->updatestate();
  13. $dtobj = c('date');
  14. $dt = $this->rock->date;
  15. $dt30 = $dtobj->adddate($dt,'d',35);
  16. $rows = m('userract')->getall("state=1 and `enddt`<='$dt30'",'id,enddt,httype,name,uname');
  17. $str = '';
  18. foreach($rows as $k=>$rs){
  19. $jg = $dtobj->datediff('d', $dt, $rs['enddt']);
  20. if($jg==30 || $jg<=7){
  21. $str.='人员['.$rs['uname'].']的【'.$rs['httype'].'.'.$rs['name'].'】将在'.$jg.'天后的'.$rs['enddt'].'到期;';
  22. }
  23. }
  24. if($str != ''){
  25. $this->todoarr = array(
  26. 'modenum' => 'userract',
  27. 'agentname' => '员工合同',
  28. 'title' => '员工合同到期提醒',
  29. 'cont' => $str,
  30. );
  31. }
  32. //生日提醒
  33. m('flow')->initflow('userinfo')->birthdaytodo();
  34. //自动从考核项目中添加
  35. m('flow')->initflow('hrcheck')->hrkaohemrun();
  36. //个人资料完善提醒
  37. return 'success';
  38. }
  39. }
粤ICP备19079148号