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


PHP Student::order_by_as_fullname方法代码示例

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


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

示例1: table_content

 public function table_content()
 {
     $filter = $this->input->post('filter');
     $this->store_filter($filter);
     $students = new Student();
     if (isset($filter['fullname']) && trim($filter['fullname']) != '') {
         $students->like('fullname', trim($filter['fullname']));
     }
     if (isset($filter['email']) && trim($filter['email']) != '') {
         $students->like('email', trim($filter['email']));
     }
     if (isset($filter['course']) && $filter['course'] !== '') {
         $students->where_related('participant/course', 'id', (int) $filter['course']);
         $students->where_related('participant', 'allowed', 1);
     }
     $order_by_direction = $filter['order_by_direction'] == 'desc' ? 'desc' : 'asc';
     if ($filter['order_by_field'] == 'fullname') {
         $students->order_by_as_fullname('fullname', $order_by_direction);
     } elseif ($filter['order_by_field'] == 'email') {
         $students->order_by('email', $order_by_direction);
     }
     $students->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/students/table_content.tpl', array('students' => $students));
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:24,代码来源:students.php

示例2: get_valuation_table_data

 private function get_valuation_table_data($course_id, $group_id = NULL, $condensed = FALSE)
 {
     $table_data = array('header' => array(), 'content' => array());
     $course = new Course();
     $course->get_by_id(intval($course_id));
     $group = new Group();
     $group->get_by_id((int) $group_id);
     if ($course->exists()) {
         $students = new Student();
         $students->select('id, fullname, email');
         $students->include_related('participant/group', array('id', 'name'));
         $students->where_related('participant/course', 'id', $course->id);
         $students->where_related('participant', 'allowed', 1);
         $students->order_by_as_fullname('fullname');
         if ($group->exists()) {
             $students->where_related('participant/group', 'id', (int) $group_id);
         }
         $students->get_iterated();
         $task_sets_out_of_group_ids = array(0);
         $task_sets_data = array();
         $task_sets_ids = array();
         $projects_ids = array();
         if ($group->exists()) {
             $students_filter = new Student();
             $students_filter->select('id');
             $students_filter->where_related('participant/course', 'id', $course->id);
             $students_filter->where_related('participant', 'allowed', 1);
             $students_filter->where_related('participant/group', 'id', (int) $group->id);
             $solutions_filter = new Solution();
             $solutions_filter->select('id');
             $solutions_filter->where_in_subquery('student_id', $students_filter);
             $task_sets_out_of_group = new Task_set();
             $task_sets_out_of_group->select('id');
             $task_sets_out_of_group->where_in_subquery('id', $solutions_filter);
             $task_sets_out_of_group->where('published', 1);
             $task_sets_out_of_group->get();
             $task_sets_out_of_group_ids = $task_sets_out_of_group->all_to_single_array('id');
             $task_sets_out_of_group_ids[] = 0;
         }
         $content_type_task_set = new Task_set();
         $content_type_task_set->select('id, name, content_type, group_id, task_set_type_id');
         $content_type_task_set->include_related('task_set_type', 'name');
         $content_type_task_set->include_related('group', 'name');
         $content_type_task_set->where('content_type', 'task_set');
         $content_type_task_set->where('published', 1);
         $content_type_task_set->where_related_course($course);
         $content_type_task_set->order_by_related_with_constant('task_set_type', 'name', 'asc');
         $content_type_task_set->order_by('task_set_type_id', 'asc');
         $content_type_task_set->order_by('publish_start_time', 'asc');
         if ($group->exists()) {
             $content_type_task_set->group_start();
             $content_type_task_set->group_start('', 'OR ');
             $content_type_task_set->group_start();
             $content_type_task_set->or_where('group_id', NULL);
             $content_type_task_set->or_where('group_id', (int) $group_id);
             $content_type_task_set->group_end();
             $content_type_task_set->where_subquery(0, '(SELECT COUNT(`tsp`.`id`) AS `count` FROM `task_set_permissions` tsp WHERE `tsp`.`task_set_id` = `task_sets`.`id` AND `tsp`.`enabled` = 1)');
             $content_type_task_set->group_end();
             $content_type_task_set->group_start('', 'OR ');
             $content_type_task_set->where_related('task_set_permission', 'group_id', (int) $group_id);
             $content_type_task_set->where_related('task_set_permission', 'enabled', 1);
             $content_type_task_set->group_end();
             $content_type_task_set->or_where_in('id', $task_sets_out_of_group_ids);
             $content_type_task_set->group_end();
         }
         $content_type_task_set->get();
         $header_items = array();
         if ($content_type_task_set->result_count() > 0) {
             $last_task_set_type_id = NULL;
             foreach ($content_type_task_set->all as $task_set) {
                 $permissions = new Task_set_permission();
                 $permissions->select('id, group_id');
                 $permissions->include_related('group', 'name');
                 $permissions->where_related_task_set($task_set);
                 $permissions->where('enabled', 1);
                 $permissions->get_iterated();
                 if ($permissions->result_count() > 0) {
                     $group_ids = array();
                     $group_names = array();
                     foreach ($permissions as $permission) {
                         $group_ids[] = $permission->group_id;
                         $group_names[] = $this->lang->text($permission->group_name);
                     }
                     $task_sets_data[$task_set->id] = array('group_id' => $group_ids, 'group_name' => $group_names);
                 } else {
                     $task_sets_data[$task_set->id] = array('group_id' => array($task_set->group_id), 'group_name' => $this->lang->text($task_set->group_name));
                 }
                 if ($task_set->task_set_type_id !== $last_task_set_type_id) {
                     $last_task_set_type_id = $task_set->task_set_type_id;
                     $header_items[] = array('type' => 'task_set_type', 'id' => $task_set->task_set_type_id, 'name' => $this->lang->text($task_set->task_set_type_name), 'title' => '');
                 }
                 if (!$condensed) {
                     $header_items[] = array('type' => 'task_set', 'id' => $task_set->id, 'name' => $this->lang->get_overlay_with_default('task_sets', $task_set->id, 'name', $task_set->name), 'title' => is_array($task_sets_data[$task_set->id]['group_name']) ? implode(', ', $task_sets_data[$task_set->id]['group_name']) : $task_sets_data[$task_set->id]['group_name']);
                 }
                 $task_sets_ids[] = $task_set->id;
             }
         }
         $table_data['header']['content_type_task_set'] = array('content_type_name' => $this->lang->line('admin_solutions_valuation_tables_header_content_type_task_sets'), 'items' => $header_items);
         $content_type_project = new Task_set();
         $content_type_project->where('content_type', 'project');
//.........这里部分代码省略.........
开发者ID:andrejjursa,项目名称:list-lms,代码行数:101,代码来源:solutions.php

示例3: edit

 public function edit()
 {
     $this->_select_teacher_menu_pagetag('task_sets');
     $url = $this->uri->ruri_to_assoc(3);
     $task_set_id = isset($url['task_set_id']) ? intval($url['task_set_id']) : intval($this->input->post('task_set_id'));
     $task_set = new Task_set();
     $task_set->get_by_id($task_set_id);
     $ps_data = array();
     $nps_data = array();
     if ($task_set->exists() && $task_set->content_type == 'project') {
         $project_selections = new Project_selection();
         $project_selections->select('*');
         $project_selections->include_related('student', array('fullname', 'email'));
         $project_selections->where_related($task_set);
         $project_selections->include_related('task', 'name');
         $project_selections->include_related('task/task_set', 'id');
         $project_selections->where_related('task/task_set', 'id', $task_set->id);
         $project_selections->order_by('task_task_task_set_rel.sorting', 'ASC');
         $project_selections->order_by_related_as_fullname('student', 'fullname', 'asc');
         $project_selections->get();
         if ($project_selections->exists()) {
             foreach ($project_selections->all as $project_selection) {
                 $ps_data[$project_selection->task_id][] = $project_selection;
             }
         }
         $project_selections->select_func('COUNT', '@id', 'count');
         $project_selections->where('task_set_id', 'participant_course_task_sets.id', false);
         $project_selections->where_related('student', 'id', '${parent}.id');
         $students = new Student();
         $students->where_related('participant/course/task_set', $task_set);
         $students->where_related('participant', 'allowed', 1);
         $students->where_subquery(0, $project_selections);
         $students->order_by_as_fullname('fullname', 'asc');
         $students->get();
         if ($students->exists()) {
             $nps_data = $students->all;
         }
     }
     $this->_add_tinymce4();
     $this->parser->add_js_file('jquery.activeform.js');
     $this->parser->add_js_file('admin_task_sets/edit.js');
     $this->parser->add_js_file('admin_task_sets/form.js');
     $this->parser->add_css_file('admin_task_sets.css');
     $this->inject_courses();
     $this->inject_languages();
     $this->inject_test_types();
     $this->inject_course_groups();
     $this->inject_course_group_rooms();
     $this->inject_course_task_set_types();
     $this->parser->parse('backend/task_sets/edit.tpl', array('task_set' => $task_set, 'project_selections' => $ps_data, 'not_project_selections' => $nps_data));
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:51,代码来源:task_sets.php

示例4: inject_students

 private function inject_students()
 {
     $students = new Student();
     $students->order_by_as_fullname('fullname');
     $students->get_iterated();
     $data = array();
     foreach ($students as $student) {
         $data[$student->id] = $student->fullname . ' (' . $student->email . ')';
     }
     $this->parser->assign('students', $data);
 }
开发者ID:andrejjursa,项目名称:list-lms,代码行数:11,代码来源:logs.php


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