public static void getNexts() { List<Creativo> creativos = Creativo.find("rank = 0").fetch(); List<Business> business = Business.find("rank = 0").fetch(); render(creativos, business); }
public static void postDate(String code, String userId, int rank) { Logger.info(code); Logger.info(userId); Logger.info("" + rank); if (code.equals(Business.BUSINESS)) { Business b = Business.findById(userId); b.rank = rank; b.save(); } else if (code.equals(Developer.DEVELOPER)) { Developer d = Developer.findById(userId); d.rank = rank; d.save(); } else if (code.equals(Creativo.CREATIVO)) { Creativo c = Creativo.findById(userId); c.rank = rank; c.save(); } render(); }
public static void getRank() { List<Creativo> creativos = Creativo.find("rank <> 0 order by rank desc").fetch(); List<Business> business = Business.find("rank <> 0 order by rank desc").fetch(); render(creativos, business); }