示例#1
0
 public function update()
 {
     $id = I('id', NULL);
     if (!empty($id)) {
         $article = new GonggaoModel();
         if ($data = $article->create()) {
             if (false !== $article->save()) {
                 $this->message('编辑成功', __URL__ . '/index');
             } else {
                 $this->message('编辑失败:' . $article->getError(), __URL__ . '/index');
             }
         } else {
             $this->message('编辑失败:' . $article->getError(), __URL__ . '/index');
         }
     } else {
         $this->message('请选择编辑对象', __URL__ . '/index');
     }
 }