Esempio n. 1
0
 public function get(Application $app, Request $request)
 {
     $schoolUtil = new MobileSchoolUtil();
     $apps = $schoolUtil->searchSchoolApps();
     return $this->filter($apps);
 }
 protected function getTarget($type, $id)
 {
     $target = array('type' => $type, 'id' => $id);
     switch ($type) {
         case 'course':
             $course = $this->getCourseService()->getCourse($id);
             $target['title'] = $course['title'];
             $target['image'] = $this->getFileUrl($course['smallPicture']);
             break;
         case 'classroom':
             $classroom = $this->getClassroomService()->getClassroom($id);
             $target['title'] = $classroom['title'];
             $target['image'] = $this->getFileUrl($classroom['smallPicture']);
         case 'global':
             $schoolUtil = new MobileSchoolUtil();
             $schoolApp = $schoolUtil->getAnnouncementApp();
             $target['title'] = '网校公告';
             $target['id'] = $schoolApp['id'];
             $target['image'] = $this->getFileUrl($schoolApp['avatar']);
         default:
             # code...
             break;
     }
     return $target;
 }
Esempio n. 3
0
 public function get(Application $app, Request $request, $id)
 {
     $schoolUtil = new MobileSchoolUtil();
     $app = $schoolUtil->findSchoolAppById($id);
     return $this->filter($app);
 }