Tu tarea parece bastante simple
en lugar de
->where_in('App.id',$subquery) //<-- Here is the problem
puedes probar lo siguiente
->where("App.id IN (".$subquery.")",NULL, false)
Tu tarea parece bastante simple
en lugar de
->where_in('App.id',$subquery) //<-- Here is the problem
puedes probar lo siguiente
->where("App.id IN (".$subquery.")",NULL, false)