projectModel.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * 项目的
  4. */
  5. class flow_projectClassModel extends flowModel
  6. {
  7. public function initModel()
  8. {
  9. $this->workobj = m('work');
  10. }
  11. /**
  12. * 进度报告时更新对应状态
  13. */
  14. protected function flowaddlog($a)
  15. {
  16. if($a['name']=='进度报告'){
  17. $arr['status'] = $a['status'];
  18. $this->update($arr, $this->id);
  19. }
  20. }
  21. public function flowrsreplace($rs, $lx=0){
  22. $zts = $rs['status'];
  23. $str = $this->getstatus($rs,'','',1);
  24. if($lx==2)$rs['statusstr']= $str; //列表时替换
  25. $id = $rs['id'];
  26. $wwc = $this->workobj->rows('projectid='.$id.' and `status` not in(1,5)');
  27. $wez = $this->workobj->rows('projectid='.$id.'');
  28. if($wwc>0)$wwc='<font color=red>'.$wwc.'</font>';
  29. $rs['workshu'] = ''.$wwc.'/'.$wez.'';
  30. if($lx==1)$rs['status'] = $str;
  31. return $rs;
  32. }
  33. public function flowisreadqx()
  34. {
  35. return $this->flowgetoptmenu('shwview');
  36. }
  37. //显示操作菜单判断
  38. protected function flowgetoptmenu($num)
  39. {
  40. $fuzeid = $this->rs['fuzeid'];
  41. $runuserid = $this->rs['runuserid'];
  42. $where = m('admin')->gjoin($fuzeid.','.$runuserid, 'ud', $blx='where');
  43. $where = 'id='.$this->adminid.' and ('.$where.')';
  44. $bo = null;
  45. if($num=='shwview')$bo = true;
  46. if(m('admin')->rows($where)==0)$bo=false;
  47. return $bo;
  48. }
  49. protected function flowbillwhere($uid, $lx)
  50. {
  51. return array(
  52. 'where' => '',
  53. 'order' => 'optdt desc'
  54. );
  55. }
  56. }
粤ICP备19079148号