$transaction=Yii::app()->db->beginTransaction();try{ $model1->save(); $model2->save(); $model3->save(); $model4->save(); $model5->save(); //出錯(cuò) $model6->save(); $transaction->commit();} catch(Exception $e){ $transaction->rollBack();}model1 , model2 , model3 , model4 , model5 照樣存儲(chǔ)成功!
- 2 回答
- 0 關(guān)注
- 929 瀏覽
添加回答
舉報(bào)
0/150
提交
取消