mode_hrkaohemAction.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <?php
  2. /**
  3. * 此文件是流程模块【hrkaohem.考核项目】对应控制器接口文件。
  4. */
  5. class mode_hrkaohemClassAction extends inputAction{
  6. protected function savebefore($table, $arr, $id, $addbo){
  7. $data = $this->getsubtabledata(0);
  8. if(count($data)==0)return '至少要有一行考核项目内容';
  9. $wqz = 0;
  10. foreach($data as $k=>$rs)$wqz+=floatval($rs['weight']);
  11. //if(round($wqz,2)!=100)return '考核项目内容权重加起来必须100%';
  12. $data = $this->getsubtabledata(1);
  13. if(count($data)==0)return '至少要有一行评分人';
  14. $wqz = 0;
  15. foreach($data as $k=>$rs)$wqz+=floatval($rs['pfweight']);
  16. if(round($wqz,2)!=100)return '评分人的权重加起来必须100%';
  17. }
  18. protected function saveafter($table, $arr, $id, $addbo){
  19. }
  20. //复制
  21. public function copyfuzAjax()
  22. {
  23. $sid = (int)$this->get('sid');
  24. $arow= m('hrkaohem')->getone($sid);
  25. if(!$arow)return;
  26. unset($arow['id']);
  27. $arow['optdt'] = $this->rock->now;
  28. $arow['optname'] = $this->adminname;
  29. $arow['optid'] = $this->adminid;
  30. $mid = m('hrkaohem')->insert($arow);
  31. $dbs = m('hrkaohes');
  32. $dbn = m('hrkaohen');
  33. $nrows= $dbs->getall("`mid`='$sid'");
  34. foreach($nrows as $k=>$rs){
  35. $rs['mid'] = $mid;
  36. unset($rs['id']);
  37. $dbs->insert($rs);
  38. }
  39. $nrows= $dbn->getall("`mid`='$sid'");
  40. foreach($nrows as $k=>$rs){
  41. $rs['mid'] = $mid;
  42. unset($rs['id']);
  43. $dbn->insert($rs);
  44. }
  45. }
  46. //生成
  47. public function shengchegeAjax()
  48. {
  49. $keox = m('flow')->initflow('hrcheck')->hrkaohemrun();
  50. return '今日'.$this->rock->date.'有'.$keox.'个考核项目生成成功';
  51. }
  52. }
粤ICP备19079148号