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


PHP EfrontUser::convertUserConstraintsToSqlParameters方法代码示例

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


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

示例1: getUsers

 public function getUsers($constraints = array())
 {
     !empty($constraints) or $constraints = array('archive' => false, 'active' => true);
     list($where, $limit, $orderby) = EfrontUser::convertUserConstraintsToSqlParameters($constraints);
     $select = "u.login,u.user_type,u.user_types_ID,u.active,u.timestamp,u.archive, u.last_login,u.balance";
     $from = "users u";
     $result = eF_getTableData($from, $select, implode(" and ", $where), $orderby, $groupby, $limit);
     return EfrontUser::convertDatabaseResultToUserArray($result);
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:9,代码来源:user.class-backup.php

示例2: countLessonUsersIncludingUnassigned

 /**
  * Count lesson users based on the specified constraints, including unassigned
  * @param array $constraints The constraints for the query
  * @return array An array of EfrontUser objects
  * @since 3.6.3
  * @access public
  */
 public function countLessonUsersIncludingUnassigned($constraints = array())
 {
     !empty($constraints) or $constraints = array('archive' => false, 'active' => true);
     list($where, $limit, $orderby) = EfrontUser::convertUserConstraintsToSqlParameters($constraints);
     $where[] = "user_type != 'administrator'";
     $select = "u.login";
     $from = "users u left outer join (select completed,score,lessons_ID,from_timestamp,users_LOGIN from users_to_lessons where lessons_ID='" . $this->lesson['id'] . "' and archive=0) r on u.login=r.users_LOGIN";
     if (G_VERSIONTYPE == 'enterprise') {
         #cpp#ifdef ENTERPRISE
         if (isset($constraints['branch']) && $constraints['branch']) {
             $from .= " JOIN module_hcd_employee_works_at_branch ON module_hcd_employee_works_at_branch.users_login = u.login";
         }
         if (isset($constraints['jobs']) && $constraints['jobs']) {
             $from .= " LEFT OUTER JOIN module_hcd_employee_has_job_description ON module_hcd_employee_has_job_description.users_login = u.login JOIN module_hcd_job_description ON module_hcd_job_description.job_description_ID = module_hcd_employee_has_job_description.job_description_ID";
         }
     }
     #cpp#endif
     $result = eF_countTableData($from, $select, implode(" and ", $where));
     return $result[0]['count'];
 }
开发者ID:jiangjunt,项目名称:efront_open_source,代码行数:27,代码来源:lesson.class.php

示例3: getCourseUsersAggregatingResultsIncludingUnassigned

 /**
  * Get course users based on the specified constraints, but include unassigned users as well. If the course
  * has instances, then propagate user status in the mother course
  *
  * @param array $constraints The constraints for the query
  * @return array An array of EfrontUser objects
  * @since 3.6.2
  * @access public
  */
 public function getCourseUsersAggregatingResultsIncludingUnassigned($constraints = array())
 {
     !empty($constraints) or $constraints = array('archive' => false, 'active' => true);
     list($where, $limit, $orderby) = EfrontUser::convertUserConstraintsToSqlParameters($constraints);
     $from = "users u left outer join\n\t\t\t\t\t(select users_LOGIN,max(score) as score, max(completed) as completed, 1 as has_course from\n\t\t\t\t\t\t(select uc.user_type as role, uc.score,uc.completed,uc.users_LOGIN from courses c left outer join users_to_courses uc on uc.courses_ID=c.id where (c.id=" . $this->course['id'] . " or c.instance_source=" . $this->course['id'] . ") and uc.archive=0) foo\n\t\t\t\t\tgroup by users_LOGIN) r on u.login=r.users_login";
     $result = eF_getTableData($from, "u.*, r.*", implode(" and ", $where), $orderby, $groupby, $limit);
     if (!isset($constraints['return_objects']) || $constraints['return_objects'] == true) {
         return EfrontUser::convertDatabaseResultToUserObjects($result);
     } else {
         return EfrontUser::convertDatabaseResultToUserArray($result);
     }
 }
开发者ID:kaseya-university,项目名称:efront,代码行数:21,代码来源:course.class.php

示例4: countGroupUsersIncludingUnassigned

 /**
  * Count group users based on the specified constraints, including unassigned
  * @param array $constraints The constraints for the query
  * @return int the number of entries in the result set
  * @since 3.6.3
  * @access public
  */
 public function countGroupUsersIncludingUnassigned($constraints = array())
 {
     !empty($constraints) or $constraints = array('archive' => false, 'active' => true);
     list($where, $limit, $orderby) = EfrontUser::convertUserConstraintsToSqlParameters($constraints);
     $result = eF_countTableData("users u left outer join users_to_groups ug  on ug.users_LOGIN=u.login and ug.groups_ID=" . $this->group['id'], "u.login, ug.groups_ID is not null as has_group", implode(" and ", $where));
     return $result[0]['count'];
 }
开发者ID:bqq1986,项目名称:efront,代码行数:14,代码来源:group.class.php


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