Law lured Wang Zhi and BB to Rockey Port for them to kill each other (in the style he wanted from Kaido and Doffy), Koby showed up there to protect the citizens, indirectly helped Teach defeat the guy and Law took the 100 hearts from the crew of the Remnant of the Rocks and delivered to the Navy.
Everyone left satisfied
Teach took Hachinosu Island (which was Whang Zhi territory)
Koby protected the citizens and became a hero of the Navy
Law turned shichibukai
Whang Zhi ended up in Impel Down or dead, but that's detail