exists() ) { throw new AlertException("你已为TA助力", 102); } \DB::beginTransaction(); try { \DB::table('kdgx_gnight_voice_invite')->insert([ 'created_at' => time(), 'uid' => $share_uid, 'invite_uid' => $uid ]); $voice_id = Voice::pop($share_uid); \DB::table('kdgx_gnight_get_voice')->insert([ 'created_at' => time(), 'uid' => $share_uid, 'get_uid' => $voice_id ]); \DB::commit(); $notive = new Notive(); $notive->getVoice($share_uid); return array( 'code' => 200, 'message' => 'success' ); } catch (\Exception $e) { \DB::rollBack(); throw $e; } } }