예제 #1
0
 /**
  * get User Courses
  * @param type $userId
  * @return type
  */
 public static function getUserCourses($userId = null)
 {
     if (empty($userId)) {
         $userId = \app\components\OvcUser::getCurrentUser()->id;
     }
     $userCourseIds = self::getCourseIdsByUserId($userId);
     return Course::findAll(['id' => $userCourseIds]);
 }
예제 #2
0
파일: Lessons.php 프로젝트: pr-of-it/profit
 public function actionDefault($course = null)
 {
     if (null === $course) {
         $this->data->course = 'all';
         $this->data->courses = Course::findAll();
     } else {
         $this->data->course = Course::findByPK($course);
         $this->data->item = new Lesson();
         $this->data->item->course = $this->data->course;
     }
 }
예제 #3
0
파일: Courses.php 프로젝트: pr-of-it/profit
 public function actionDefault()
 {
     $this->data->items = Course::findAll(['order' => 'active desc']);
     $this->data->item = new Course();
 }