table_common_card_log.php 1021 B

12345678910111213141516171819202122232425262728293031323334353637
  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_card_log.php 31076 2012-07-13 03:30:58Z zhangjie $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_card_log extends discuz_table_archive
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_card_log';
  15. $this->_pk = 'id';
  16. parent::__construct();
  17. }
  18. public function fetch_by_operation($operation) {
  19. return DB::fetch_first('SELECT * FROM %t WHERE operation=%d ORDER BY dateline DESC LIMIT 1', array($this->_table, $operation));
  20. }
  21. public function fetch_all_by_operation($operation, $start = 0, $limit = 0) {
  22. return DB::fetch_all('SELECT * FROM %t WHERE operation=%d ORDER BY dateline DESC '.DB::limit($start, $limit), array($this->_table, $operation));
  23. }
  24. public function count_by_operation($operation) {
  25. return DB::result_first('SELECT COUNT(*) FROM %t WHERE operation=%d', array($this->_table, $operation));
  26. }
  27. }
  28. ?>