receiptModel.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <?php
  2. class flow_receiptClassModel extends flowModel
  3. {
  4. public function flowrsreplace($rs, $slx=0)
  5. {
  6. $rs['modenumshow'] = $rs['modenum'];
  7. $rs['modenum'] = '';
  8. $fte = '<font color=red>停用</font>';
  9. if($rs['status']=='1'){
  10. $fte = '<font color=green>启用</font>';
  11. }
  12. $rs['status'] = $fte;
  13. $rs['ishui']=0;
  14. //判断是否已确认
  15. if($slx==2){
  16. $lx = $this->atype;
  17. if($lx=='my' || $lx=='myall'){
  18. if(contain(','.$rs['receids'].',',','.$this->adminid.','))$rs['ishui']=1;
  19. }
  20. }
  21. return $rs;
  22. }
  23. public function getweiwhere($uid, $lx)
  24. {
  25. $where = '';
  26. if($lx=='my' || $lx=='myall'){
  27. $where = ' and '.$this->rock->dbinstr('receid', $uid).''; //需要我回执
  28. //为确认
  29. if($lx=='my'){
  30. $where .= ' and (not '.$this->rock->dbinstr('receids', $uid).' or `receids` is null)';
  31. }
  32. }
  33. return $where;
  34. }
  35. //未确认统计
  36. public function getweitotal($uid)
  37. {
  38. $where = $this->getweiwhere($uid, 'my');
  39. $to = $this->rows('`status`=1 '.$where.'');
  40. return $to;
  41. }
  42. protected function flowbillwhere($uid, $lx)
  43. {
  44. $where = $this->getweiwhere($uid, $lx);
  45. return $where;
  46. }
  47. protected function flowsubmit($na, $sm)
  48. {
  49. if($this->rs['status']==1)$this->tisongtodo();
  50. }
  51. //审核完成后发通知
  52. protected function flowcheckfinsh($zt)
  53. {
  54. if($zt==1)$this->tisongtodo();
  55. }
  56. //推送提醒
  57. private function tisongtodo()
  58. {
  59. $this->pushs($this->rs['receid'], "模块:{modename}\n发送人:{optname}\n内容:{explain}",'单据回执确认', array(
  60. 'modenum' => $this->rs['modenum'],
  61. 'id' => $this->rs['mid'],
  62. ));
  63. }
  64. }
粤ICP备19079148号