scheduleModel.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. class flow_scheduleClassModel extends flowModel
  3. {
  4. public $ratearr;
  5. protected function flowinit(){
  6. $this->ratearr = array('d'=>'天','w'=>'周','m'=>'月');
  7. }
  8. //是否有读权限
  9. public function flowisreadqx()
  10. {
  11. if(!isempt($this->rs['receid'])){
  12. $where = m('admin')->gjoin($this->rs['receid'], 'ud', $blx='where');
  13. $where = 'id='.$this->adminid.' and ('.$where.')';
  14. $bo = true;
  15. if(m('admin')->rows($where)==0)$bo=false;
  16. return $bo;
  17. }else{
  18. return false;
  19. }
  20. }
  21. public function getstatusarr()
  22. {
  23. $barr[1] = array('启用','green');
  24. $barr[0] = array('停用','#888888');
  25. return $barr;
  26. }
  27. public function flowrsreplace($rs, $lx=0)
  28. {
  29. $txsj = (int)$rs['txsj'];
  30. $str = '不提醒';
  31. if($txsj==1)$str = '提醒';
  32. $rs['txsj'] = $str;
  33. $rate = $rs['rate'];
  34. if(isset($this->ratearr[$rate])){
  35. if($rate=='w')$rate='每周'.$rs['rateval'].'';
  36. if($rate=='d')$rate='每'.$rs['rateval'].'天';
  37. if($rate=='m')$rate='每月'.$rs['rateval'].'号';
  38. $rs['rate'] = $rate;
  39. }
  40. if($rs['status']==0)$rs['ishui']=1;
  41. if($lx==1){
  42. $barrs = $this->getstatusarr();
  43. $zts = $barrs[$rs['status']];
  44. $rs['status'] = '<font color="'.$zts[1].'">'.$zts[0].'</font>';
  45. }
  46. return $rs;
  47. }
  48. protected function flowbillwhere($uid, $lx)
  49. {
  50. $where = '';
  51. $dt = $this->rock->post('dt');
  52. if($dt!='')$where =" and `startdt` like '$dt%'";
  53. return array(
  54. 'keywhere' => $where,
  55. 'order' => 'optdt desc'
  56. );
  57. }
  58. }
粤ICP备19079148号