I think you just need to reset the flag at the end of update, see also
candosomething = false;
this.physics.add.collider(player, platforms, check_collision, null, this);
function check_collision (player, platforms)
{
candosomething = true;
}
function update() {
...
if (candosomething) {
}
...
candosomething = false;
}