1
0

scheduleModel.php 1.5 KB

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