This question already has an answer here:
There are sub-components for commands. for instance: /kill @e[type=!minecraft:player].
the command you're looking for is /tp @a[radius=2] (coordinates of another platform)
just set the command block to "repeat" and "always active" and be on your way!!
note that the command block will have to be placed as that middle block. alternatively, extend the radius to 3 or 4.