{
$map['id']=I('post.id');//獲取id
//獲取id-用來關聯留言數據表中數據保持數據的一致性
$data_m['nick']=$data['nick'];
$map_m['uid']=I('post.id');
$res=$this->person_model->where($map)->save($data);
$res_m=$this->message_model->where($map_m)->save($data_m);//保持message和person表保持一致
if($res){
if($res_m)
$this->success("修改成功,正在跳轉...",U('/Index/index'));
}else{
$this->error("修改失敗,正在跳轉...1");
}
}else{
$this->error("修改失敗,正在跳轉...2");
}
在此基礎上修改session緩存的問題
$map['id']=I('post.id');//獲取id
//獲取id-用來關聯留言數據表中數據保持數據的一致性
$data_m['nick']=$data['nick'];
$map_m['uid']=I('post.id');
$res=$this->person_model->where($map)->save($data);
$res_m=$this->message_model->where($map_m)->save($data_m);//保持message和person表保持一致
if($res){
$user=$this->person_model->where($map)->find();
session('user', null);
session('user', $user);//校驗成功存入session中
$this->success("修改成功,正在跳轉...",U('/Index/index'));
}else{
$this->error("修改失敗,正在跳轉...2");
}