function shiwu(){ $this -> startTrans(); // Perform related business logic operations $data ['video_status']=1 ; $video_id = $this ->insertGetId( $data ); // Save user information if ( true ){ // Commit the transaction $this -> commit(); return $video_id ; } else { // Transaction rollback $this -> rollback(); } }