1
0

mode_workAction.php 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. class mode_workClassAction extends inputAction{
  3. protected function savebefore($table, $arr, $id, $addbo){
  4. $distid = arrvalue($arr,'distid');
  5. $dist = arrvalue($arr,'dist');
  6. $this->oharr = array();
  7. if(!isempt($distid)){
  8. if(contain($distid,'u') || contain($distid,'d') || contain($distid,'g'))return '分配给人员必须使用多选或者单选';
  9. $jscj = (int)$this->post('temp_cjall','0');
  10. if($jscj==1 && contain($distid,',')){
  11. $distida = explode(',', $distid);
  12. $dista = explode(',', $dist);
  13. if(count($distida)>1){
  14. foreach($distida as $k1=>$v1){
  15. if($k1>0){
  16. $this->oharr[] = array(
  17. 'distid' => $distida[$k1],
  18. 'dist' => $dista[$k1],
  19. );
  20. }
  21. }
  22. $rows = array();
  23. $rows['distid'] = $distida[0];
  24. $rows['dist'] = $dista[0];
  25. return array(
  26. 'rows' => $rows
  27. );
  28. }
  29. }
  30. }
  31. }
  32. protected function saveafter($table, $arr, $id, $addbo){
  33. if($this->oharr){
  34. $sysisturn = (int)$this->post('istrun','1');
  35. $subna = '';
  36. if($sysisturn==0)$subna='保存';
  37. foreach($this->oharr as $k1=>$rs1){
  38. $arr['distid'] = $rs1['distid'];
  39. $arr['dist'] = $rs1['dist'];
  40. $arr['zhuid'] = $id;
  41. unset($arr['id']);
  42. $nid = m($table)->insert($arr);
  43. $this->flow->loaddata($nid, false);
  44. $this->flow->submit($subna);
  45. }
  46. }
  47. }
  48. public function projectdata()
  49. {
  50. $rows = m('project')->getall('id>0 and status in(0,3)','`id`,`type`,`title`,`progress`','optdt desc');
  51. $arr = array();
  52. foreach($rows as $k=>$rs){
  53. $arr[] = array(
  54. 'name' => '['.$rs['type'].']'.$rs['title'].'('.$rs['progress'].'%)',
  55. 'value' => $rs['id']
  56. );
  57. }
  58. return $arr;
  59. }
  60. }
粤ICP备19079148号