table_connect_memberbindlog.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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_connect_memberbindlog.php 29265 2012-03-31 06:03:26Z yexinhao $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_connect_memberbindlog extends discuz_table {
  12. public function __construct() {
  13. $this->_table = 'connect_memberbindlog';
  14. $this->_pk = 'mblid';
  15. parent::__construct();
  16. }
  17. public function count_uid_by_openid_type($openid, $type) {
  18. $count = (int) DB::result_first('SELECT count(DISTINCT uid) FROM %t WHERE uin=%s AND type=%d', array($this->_table, $openid, $type));
  19. return $count;
  20. }
  21. public function fetch_all_by_openids($openids, $start = 0, $limit = 0) {
  22. $result = array();
  23. if($openids) {
  24. $result = DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('uin', $openids).' ORDER BY dateline DESC '.DB::limit($start, $limit));
  25. }
  26. return $result;
  27. }
  28. public function fetch_all_by_uids($uids, $start = 0, $limit = 0) {
  29. $result = array();
  30. if($uids) {
  31. $result = DB::fetch_all('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field('uid', $uids).' ORDER BY dateline DESC '.DB::limit($start, $limit));
  32. }
  33. return $result;
  34. }
  35. }