Solution of the fan diagram equation in (2+1)-dimensional QCD