table_common_admingroup.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * [Discuz!] (C)2001-2099 Comsenz Inc.
  4. * This is NOT a freeware, use is subject to license terms
  5. *
  6. * $Id: table_common_admingroup.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_admingroup extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_admingroup';
  15. $this->_pk = 'admingid';
  16. parent::__construct();
  17. }
  18. public function fetch_all_merge_usergroup($gids = array()) {
  19. $admingroups = empty($gids) ? $this->range() : $this->fetch_all($gids);
  20. $data = array();
  21. foreach(C::t('common_usergroup')->fetch_all(array_keys($admingroups)) as $gid=>$value) {
  22. $data[$gid] = array_merge($admingroups[$gid], $value);
  23. }
  24. return $data;
  25. }
  26. public function fetch_all_order() {
  27. return DB::fetch_all("SELECT u.radminid, u.groupid, u.grouptitle FROM ".DB::table('common_admingroup')." a LEFT JOIN ".DB::table('common_usergroup')." u ON u.groupid=a.admingid ORDER BY u.radminid, a.admingid");
  28. }
  29. }
  30. ?>