Weierstrass integrability for a class of differential systems