hyarra = array('正常','会议中','结束','取消'); $this->hyarrb = array('green','blue','#ff6600','#888888'); $this->dbobj = c('date'); $this->reatearr = array( 'd' => '每天', 'w1' => '每周一', 'w2' => '每周二', 'w3' => '每周三', 'w4' => '每周四', 'w5' => '每周五', 'w6' => '每周六', 'w7' => '每周日', 'm' => '每月', 'y' => '每年', ); } // 初始化单据可替换其他属性,$lx,0默认,1详情展示,2列表显示,3打印页,4外部详情页 public function flowrsreplace($rs, $lx=0) { $zt = $rs['state']; $nzt = $zt; $time = time(); $stime = strtotime($rs['meeting_time']); if($zt < 2){ if($stime>$time){ // 开始时间大于当前时间,认为会议开始 $nzt = 0; } if ($nzt != 2 || $nzt != 3) { // 状态不是取消、结束,则赋值“正常” $nzt = 1; } } // 更新数据状态 if($zt != $nzt){ $this->update('state='.$nzt.'', $rs['id']); $zt = $nzt; } // 将id转换为文字 $rs['state'] = $this->getstatezt($zt); return $rs; } public function getstatezt($zt) { return ''.$this->hyarra[$zt].''; } // $ors当前单据操作信息,$crs提交过来的信息 public function flowoptmenu($ors, $crs) { if ($ors['num'] == 'delnoup') { } return null; } //删除单据时调用 public function flowdeletebill($sm) { // m('meet_sys')->deleteMeetingRoom($this->rs); } //流程全部完成后调用 public function flowcheckfinsh($sm) { } //提交时调用 protected function flowsubmit($na, $sm) { if ($this->id == null) { return ; } } }