workModel.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. //任务的应用
  3. class agent_workClassModel extends agentModel
  4. {
  5. public function gettotal()
  6. {
  7. $stotal = $this->getwdtotal($this->adminid);
  8. $titles = '';
  9. return array('stotal'=>$stotal,'titles'=> $titles);
  10. }
  11. private function getwdtotal($uid)
  12. {
  13. $to = m('work')->getwwctotals($uid);
  14. return $to;
  15. }
  16. protected function agenttotals($uid){
  17. return array(
  18. 'myrw' => $this->getwdtotal($uid)
  19. );
  20. }
  21. protected function agentrows($rows, $rowd, $uid){
  22. $rows = $this->agentrows_status($rows, $rowd);
  23. $projectarr = false;
  24. //读取我的项目
  25. if($this->loadci==1){
  26. $tos = m('flow_set')->rows("`num`='project' and `status`=1");
  27. if($tos>0){
  28. $where1 = $this->rock->dbinstr('`fuzeid`', $uid);
  29. $where2 = m('admin')->getjoinstr('`runuserid`', $uid, 1, 1);
  30. $xmrows = m('project')->getall("`status` <>5 and ($where1 or $where2)",'*');
  31. if($xmrows){
  32. $projectarr = array();
  33. foreach($xmrows as $k1=>$rs1){
  34. $projectarr[] = array(
  35. 'id' => $rs1['id'],
  36. 'name' => '['.$rs1['type'].']'.$rs1['title'].'('.$rs1['progress'].'%)',
  37. );
  38. }
  39. }
  40. }
  41. }
  42. return array(
  43. 'rows' => $rows,
  44. 'projectarr' => $projectarr
  45. );
  46. }
  47. protected function agentrows11($rows, $rowd, $uid)
  48. {
  49. $statea = $this->flow->statearr;
  50. foreach($rowd as $k=>$rs){
  51. $state = $rs['state'];
  52. if($state==3){
  53. $rows[$k]['ishui'] =1;
  54. }
  55. $ztarr = $statea[$state];
  56. $rows[$k]['statustext'] = $ztarr[0];
  57. $rows[$k]['statuscolor'] = $ztarr[1];
  58. }
  59. return $rows;
  60. }
  61. }
粤ICP备19079148号