o0无忧亦无佈 发表于 2015-7-14 22:17:28

关于事务回滚

$this->load->model('document/document_model');
$this->document_model->db->trans_begin();
$this->document_model->操作1;
$this->document_model->操作2;
$this->document_model->操作3;


$this->load->model('document/document_model111');
$this->document_model1111->操作1;
$this->document_model1111->操作2;
$this->document_model1111->操作3;




$this->document_model1111->db->trans_complete();

这样做事务回滚会生效吗?求大神解答!



xc_Lemon 发表于 2015-7-23 17:48:15

不是应该在model 中使用吗

看你的写法是在控制器里面吧

Closer 发表于 2015-7-23 22:25:52

xc_Lemon 发表于 2015-7-23 17:48
不是应该在model 中使用吗

看你的写法是在控制器里面吧

我試過可行
页: [1]
查看完整版本: 关于事务回滚