コード例 #1
0
ファイル: User.php プロジェクト: krisrita/udo
 /**
  * 重置手机号
  */
 public function resetMobile($uid, $password, $mobileNew, $code)
 {
     if ($this->isUserExists($mobileNew)) {
         return Common_Error::ERROR_USER_EXISTS;
     }
     $errno = $this->checkPassword($uid, $password);
     if (true !== $errno) {
         return $errno;
     }
     $errno = $this->checkCode($mobileNew, $code);
     if (true !== $errno) {
         return $errno;
     }
     $tblUser = new DB_Howdo_User();
     return $tblUser->update($uid, array("mobile" => $mobileNew));
 }
コード例 #2
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;
 }