mode_gongAction.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * 此文件是流程模块【gong.通知公告】对应接口文件。
  4. * 可在页面上创建更多方法如:public funciton testactAjax(),用js.getajaxurl('testact','mode_gong|input','flow')调用到对应方法
  5. */
  6. class mode_gongClassAction extends inputAction{
  7. protected function savebefore($table, $arr, $id, $addbo){
  8. //$uarr['receid'] = $this->flow->getreceids($arr['receid']);
  9. $uarr = array();
  10. if(!isset($arr['issms']))$uarr['issms']=0;
  11. return array(
  12. 'rows' => $uarr
  13. );
  14. }
  15. protected function saveafter($table, $arr, $id, $addbo){
  16. }
  17. //提交投票
  18. public function submittoupiaoAjax()
  19. {
  20. $mid = (int)$this->get('mid');
  21. $sid = c('check')->onlynumber($this->get('sid'));
  22. $modenum = $this->get('modenum');
  23. $this->flow = m('flow')->initflow($modenum);
  24. $towheer = "`table`='infor' and `mid`='$mid' and `name`='投票' and `checkid`='$this->adminid'";
  25. if($this->flow->flogmodel->rows($towheer)>0)return '你已投票了';
  26. $this->flow->addlog(array(
  27. 'name' => '投票',
  28. 'mid' => $mid,
  29. 'explain' => '投票项ID('.$sid.')'
  30. ));
  31. m('infors')->update('`touci`=`touci`+1','`mid`='.$mid.' and `id` in('.$sid.')');
  32. echo 'ok';
  33. }
  34. }
粤ICP备19079148号