table_common_member_medal.php 1019 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_member_medal.php 27772 2012-02-14 06:48:34Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_member_medal extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_member_medal';
  15. $this->_pk = '';
  16. parent::__construct();
  17. }
  18. public function fetch_all_by_uid($uid) {
  19. return !empty($uid) ? DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('uid', $uid), 'medalid') : array();
  20. }
  21. public function delete_by_uid_medalid($uid, $medalid) {
  22. return !empty($uid) && !empty($medalid) ? DB::delete($this->_table, DB::field('uid', $uid).' AND '.DB::field('medalid', $medalid)) : false;
  23. }
  24. public function count_by_uid_medalid($uid, $medalid) {
  25. return DB::result_first('SELECT COUNT(*) FROM %t WHERE uid=%d AND medalid=%d', array($this->_table, $uid, $medalid));
  26. }
  27. }
  28. ?>