Exemplo n.º 1
0
 /**
  * 修改状态
  *
  *
  */
 public function statusAction()
 {
     $id = $this->getg('id', 0);
     if (empty($id)) {
         $this->error('id 不能为空!');
     }
     $status = $this->getg('status', 0);
     $status = $status ? 0 : 1;
     // 实例化Model
     $log = new LogModel();
     $row = $log->update(array('id' => $id), array('status' => $status));
     if ($row) {
         $this->error('恭喜,操作成功', 'Message');
     } else {
         $this->error('操作失败');
     }
 }