semester_id)) { Log::info("llegaremos?"); return DB::table('transformative_action_status') ->where('trans_id', $this->id) ->where('semester_id', $this->semester_id) ->first(); } return null; } public static function getTypCoursesWithSemesters($trans_id) { return DB::table('transformative_actions') ->join('annual_plan_transformative', 'annual_plan_transformative.trans_id', '=', 'transformative_actions.id') ->join('typ_semester_courses', 'typ_semester_courses.id', '=', 'annual_plan_transformative.typ_semester_course_id') ->join('typ_semester_objectives', 'typ_semester_objectives.id', '=', 'typ_semester_courses.typ_semester_objective_id') ->join('typ_semester_outcome', 'typ_semester_outcome.id', '=', 'typ_semester_objectives.typ_semester_outcome_id') ->join('semesters', 'semesters.id', '=', 'typ_semester_outcome.semester_id') ->where('transformative_actions.id', $trans_id) ->select( 'transformative_actions.*', 'transformative_actions.id as trans_id', 'semesters.id', 'semesters.code', 'typ_semester_course_id as typ_future_course_id' ) ->get(); } public static function getCategoriesHtml($program_id) { $categories = ""; $types = DB::table('transformative_actions') ->select('type_of_TA', 'is_custom') ->where('type_of_TA', '<>', '') ->where(function ($query) use (&$program_id) { $query->whereNull('program_id') ->orWhere('program_id', $program_id); }) ->where('by_professor', 0) ->groupBy('type_of_TA') ->get(); $optGroupGeneral = ""; $optGroupCustom = ""; foreach ($types as $type) { if ($type->is_custom) { $optGroupCustom .= ""; } else { $optGroupGeneral .= ""; } } $categories .= $optGroupGeneral . ''; $categories .= $optGroupCustom . ''; $categories .= ''; return $categories; } }