table_security_eviluser.php 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_security_eviluser.php 33944 2013-09-04 07:33:32Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_security_eviluser extends discuz_table {
  12. public function __construct() {
  13. $this->_table = 'security_eviluser';
  14. $this->_pk = 'uid';
  15. parent::__construct();
  16. }
  17. public function fetch_all_report($limit = 20) {
  18. return DB::fetch_all("SELECT * FROM %t WHERE isreported = 0 AND operateresult > 0 LIMIT %d", array($this->_table, $limit));
  19. }
  20. public function range_by_operateresult($operateresult, $start, $limit) {
  21. return DB::fetch_all('SELECT * FROM %t WHERE ' . DB::field('operateresult', $operateresult) . ' ' . DB::limit($start, $limit), array($this->_table), $this->_pk);
  22. }
  23. public function fetch_range($start, $perPage = '20', $orderBy = 'createtime') {
  24. $orderSql = " ORDER BY $orderBy DESC ";
  25. $limitSql = DB::limit($start, $perPage);
  26. return DB::fetch_all("SELECT * FROM %t $orderSql $limitSql", array($this->_table));
  27. }
  28. public function count_by_day($days = 1) {
  29. return DB::result_first('SELECT COUNT(*) FROM %t WHERE operateresult = 0 AND createtime > %d', array($this->_table, TIMESTAMP - 86400 * $days));
  30. }
  31. }