コード例 #1
0
ファイル: Course.php プロジェクト: krisrita/udo
 /**
  * 课程获得老师信息
  */
 public function getCourseTeachers($courseId)
 {
     $teachers = array();
     $tblCourseTeacher = new DB_Haodu_CourseTeacher();
     $list = $tblCourseTeacher->fetchAll("teacher_id", "where course_id = {$courseId}", "order by id asc");
     if ($list) {
         $tblUser = new DB_Howdo_User();
         foreach ($list as $row) {
             $teacher = $tblUser->fetchRow($row['teacher_id'], "stuff_id as id, avator, stuff_name as name, gender, job_title, info");
             if ($teacher) {
                 $teacher['avator'] = empty($teacher['avator']) ? Common_Config::DEFAULT_AVATOR : $teacher['avator'];
                 $teacher['avator'] = Common_Config::AVATOR_BASE_URL . $teacher['avator'];
             }
             $teachers[] = $teacher;
         }
     }
     return $teachers;
 }