public function update()
{
if (!IS_POST) {
$model = M('new1')->find(I('id'));
$this->assign('model',$model);
$this->display();
}
if (IS_POST) {
$model = D("new1");
if (!$model->create()) {
$this->error($model->getError());
}else{
// dd(I());die;
$ss=$model->save();
if ($ss) {
$this->success("更新成功", U('new/index'));
} else {
$this->error($model->getDbError());
}
}
}
}
最佳答案
