projectModel.php 1.5 KB

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