当前位置: 首页>>代码示例>>PHP>>正文


PHP Participant::order_by_related_as_fullname方法代码示例

本文整理汇总了PHP中Participant::order_by_related_as_fullname方法的典型用法代码示例。如果您正苦于以下问题:PHP Participant::order_by_related_as_fullname方法的具体用法?PHP Participant::order_by_related_as_fullname怎么用?PHP Participant::order_by_related_as_fullname使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Participant的用法示例。


在下文中一共展示了Participant::order_by_related_as_fullname方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: table_content

 public function table_content()
 {
     $filter = $this->input->post('filter');
     $this->store_filter($filter);
     $participants = new Participant();
     $participants->include_related('student', 'fullname');
     $participants->include_related('student', 'email');
     $participants->include_related('course', 'name');
     $participants->include_related('course/period', 'name');
     $participants->include_related('group', 'name');
     if (isset($filter['student_fullname']) && trim($filter['student_fullname']) != '') {
         $participants->like_related('student', 'fullname', trim($filter['student_fullname']));
     }
     if (isset($filter['course']) && intval($filter['course']) > 0) {
         $participants->where_related('course', 'id', intval($filter['course']));
     }
     if (isset($filter['group']) && intval($filter['group']) > 0) {
         $participants->where_related('group', 'id', intval($filter['group']));
     }
     if (isset($filter['group_set'])) {
         if ($filter['group_set'] == 'none') {
             $participants->where('group_id', NULL);
         } else {
             if ($filter['group_set'] == 'assigned') {
                 $participants->group_start(' NOT', 'AND');
                 $participants->where('group_id', NULL);
                 $participants->group_end();
             }
         }
     }
     $order_by_direction = $filter['order_by_direction'] == 'desc' ? 'desc' : 'asc';
     if ($filter['order_by_field'] == 'student') {
         $participants->order_by_related_as_fullname('student', 'fullname', $order_by_direction);
         $participants->order_by_related('student', 'email', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'course') {
         $participants->order_by_related('course/period', 'sorting', $order_by_direction);
         $participants->order_by_related_with_constant('course', 'name', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'group') {
         $participants->order_by_related_with_constant('group', 'name', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'status') {
         $participants->order_by('allowed', $order_by_direction);
     }
     $participants->get_paged_iterated(isset($filter['page']) ? intval($filter['page']) : 1, isset($filter['rows_per_page']) ? intval($filter['rows_per_page']) : 25);
     $this->parser->parse('backend/participants/table_content.tpl', array('participants' => $participants));
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:45,代码来源:participants.php

示例2: mail_to_course

 public function mail_to_course($course_id)
 {
     $course = new Course();
     $course->include_related('period', 'name');
     $course->get_by_id((int) $course_id);
     if ($course->exists()) {
         $groups = new Group();
         $groups->where_related_course('id', $course->id);
         $groups->order_by_with_constant('name', 'asc');
         $groups->get_iterated();
         $groups_students = array();
         foreach ($groups as $group) {
             $groups_students[$group->id] = array('name' => $group->name, 'students' => array());
         }
         $groups_students[0] = array('name' => 'lang:admin_courses_mail_to_course_group_name_unassigned_students', 'students' => array());
         $participants = new Participant();
         $participants->where('allowed', 1);
         $participants->include_related('student');
         $participants->where_related_course('id', $course->id);
         $participants->order_by_related_as_fullname('student', 'fullname', 'asc');
         $participants->get_iterated();
         foreach ($participants as $participant) {
             $groups_students[(int) $participant->group_id]['students'][(int) $participant->student_id] = array('fullname' => $participant->student_fullname, 'email' => $participant->student_email);
         }
         $this->parser->assign('groups_students', $groups_students);
     }
     $this->_add_tinymce4();
     $this->parser->add_js_file('admin_courses/mail_form.js');
     $this->parser->add_css_file('admin_courses.css');
     $this->parser->parse('backend/courses/mail_to_course.tpl', array('course' => $course));
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:31,代码来源:courses.php


注:本文中的Participant::order_by_related_as_fullname方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。