Example #1
0
 public function update()
 {
     if (!IS_POST) {
         $this->message2('非法操作!', __APP__ . '/Admin');
     }
     $id = I('id', NULL);
     if (!empty($id)) {
         $model = new AdvModel();
         $adv = $model->where('id=' . $id)->find();
         $data = $model->create();
         if (false !== $model->save()) {
             $this->message('编辑成功', __URL__ . '/index');
         } else {
             $this->message('编辑失败:' . $model->getError(), __URL__ . '/index');
         }
     } else {
         $this->message('请选择编辑对象', __URL__ . '/index');
     }
 }