//修改的部分
if(I('post.id')){
$Department=D('Department');
if (!$Department->create($_POST,2)){ // 创建数据对象
$this->error($Department->getError());
}else{
$result=$Department->save();
if(false !== $result){
$id = I('post.id');
$this->redirect('updateDepartment',array('update'=>"1",'id' =>"$id"));
}else{
$this->error("数据修改失败");
}
}
}
1
zts1993 2015-03-17 10:20:13 +08:00
输出一下$Department->getlastsql();
看下sql语句是否正确 |