getForeignKey function doesn't work correct

Get the primaryKey from the foreign model instead of the primaryKey from current model