table_forum_grouplevel.php 921 B

12345678910111213141516171819202122232425262728293031323334
  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_forum_grouplevel.php 27449 2012-02-01 05:32:35Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_forum_grouplevel extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'forum_grouplevel';
  15. $this->_pk = 'levelid';
  16. parent::__construct();
  17. }
  18. public function fetch_all_creditslower_order() {
  19. return DB::fetch_all("SELECT * FROM ".DB::table('forum_grouplevel')." WHERE 1 ORDER BY creditslower");
  20. }
  21. public function fetch_count() {
  22. return DB::result_first("SELECT count(*) FROM ".DB::table('forum_grouplevel'));
  23. }
  24. public function fetch_by_credits($credits = 0) {
  25. return DB::fetch_first("SELECT * FROM %t WHERE creditshigher<=%d AND %d<creditslower LIMIT 1", array($this->_table, $credits, $credits));
  26. }
  27. }
  28. ?>