workModel.php 668 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. class workClassModel extends Model
  3. {
  4. /**
  5. * 未完成统计的也可以用m('flow')->initflow('work')->getdaiban();
  6. */
  7. public function getwwctotals($uid)
  8. {
  9. $s = $this->rock->dbinstr('distid', $uid);
  10. $to = $this->rows('`status` in(3,4) and '.$s.'');
  11. return $to;
  12. }
  13. //更新对应项目进度
  14. public function updateproject($id)
  15. {
  16. $id = (int)$id;
  17. if($id==0)return;
  18. $zshu = $this->rows('`projectid`='.$id.' and `status`<>5');
  19. $wcshu = $this->rows('`projectid`='.$id.' and `status`=1');
  20. $blix = '0';
  21. if($zshu>0){
  22. $blix = ($wcshu/$zshu) *100;
  23. }
  24. m('project')->update('progress='.$blix.'', $id);
  25. }
  26. }
粤ICP备19079148号