tovoidModel.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. class flow_tovoidClassModel extends flowModel
  3. {
  4. //展示是替换一下
  5. public function flowrsreplace($rs, $lx=0)
  6. {
  7. $str= '作废';
  8. if($rs['type']==1)$str= '删除';
  9. $rs['type'] = $str;
  10. //详情
  11. if($lx==1){
  12. $bilrs= $this->billmodel->getone("`sericnum`='".$rs['tonum']."'");
  13. if(!$bilrs){
  14. $rs['tonum']='<s>'.$rs['tonum'].'</s>';
  15. return $rs;
  16. }
  17. $mors = $this->db->getone('[Q]flow_set',"`id`='".$bilrs['modeid']."'");
  18. if(!$mors)return $rs;
  19. $url = $this->getxiangurl($mors['num'], $bilrs['mid'], 'a');
  20. $rs['tonum'] = '<a href="'.$url.'">'.$rs['tonum'].'</a>';
  21. }
  22. return $rs;
  23. }
  24. //审核完成了处理单据,删除还是作废
  25. protected function flowcheckfinsh($zt)
  26. {
  27. if($zt!=1)return;
  28. $type = $this->rs['type'];
  29. $bilrs= $this->billmodel->getone("`sericnum`='".$this->rs['tonum']."'");
  30. if(!$bilrs)return;
  31. $mors = $this->db->getone('[Q]flow_set',"`id`='".$bilrs['modeid']."'");
  32. if(!$mors)return;
  33. //作废
  34. if($type==0){
  35. m('flow')->zuofeibill($mors['num'], $bilrs['mid'], $this->rs['explain']);
  36. }
  37. //删除
  38. if($type==1){
  39. m('flow')->deletebill($mors['num'], $bilrs['mid'], $this->rs['explain'], false);
  40. }
  41. }
  42. }
粤ICP备19079148号