|
@@ -444,12 +444,26 @@ class ThreeYearPlanController extends \BaseController
|
444
|
444
|
|
445
|
445
|
$semesters_->selected_objectives = array();
|
446
|
446
|
foreach ($result_objectives as $objectives_) {
|
|
447
|
+// $result_courses = DB::table('courses')
|
|
448
|
+// ->where('courses.program_id', $program_id)
|
|
449
|
+// ->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
|
|
450
|
+// ->orderBy('courses.number', 'asc')
|
|
451
|
+// ->groupBy('courses.name', 'courses.code')
|
|
452
|
+// ->get();
|
|
453
|
+
|
447
|
454
|
$result_courses = DB::table('courses')
|
448
|
455
|
->where('courses.program_id', $program_id)
|
|
456
|
+ ->orWhereIn('courses.program_id', function ($q) use ($program_id){
|
|
457
|
+ $q->select('other_program_id')
|
|
458
|
+ ->from('other_programs_courses_typ')
|
|
459
|
+ ->where('program_id',$program_id);
|
|
460
|
+ })
|
449
|
461
|
->select('courses.id as course_id', 'courses.name', 'courses.code', 'courses.number', 'courses.program_id')
|
|
462
|
+ ->orderBy('courses.code', 'asc')
|
450
|
463
|
->orderBy('courses.number', 'asc')
|
451
|
464
|
->groupBy('courses.name', 'courses.code')
|
452
|
465
|
->get();
|
|
466
|
+
|
453
|
467
|
#los cursos resultantes creo que deberian ser: todos los que se estan dando en mi programa
|
454
|
468
|
|
455
|
469
|
$objectives_->available_courses = array();
|