Yii 事务在以下示例代码中不会回滚,并且保存在 DB 中的记录:
$transaction = Yii::app()->db->beginTransaction();
$mode_1 = new Orders;
$mode_1->id_order = 3333;
$mode_1->AWB = 3333;
$mode_2 = new Orders;
$mode_2->id_order = 4444;
$mode_2->AWB = 4444;
$mode_2->save();
$mode_1->save();
$transaction->rollback();
任何的想法?.. 谢谢