table_common_member_profile_archive.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_profile_archive.php 28589 2012-03-05 09:54:11Z zhangguosheng $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_member_profile_archive extends table_common_member_profile
  12. {
  13. protected $_fields;
  14. public function __construct() {
  15. parent::__construct();
  16. $this->_table = 'common_member_profile_archive';
  17. $this->_pk = 'uid';
  18. }
  19. public function fetch($id){
  20. return ($id = dintval($id)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)) : array();
  21. }
  22. public function fetch_all($ids) {
  23. $data = array();
  24. if(($ids = dintval($ids, true))) {
  25. $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids));
  26. while($value = DB::fetch($query)) {
  27. $data[$value[$this->_pk]] = $value;
  28. }
  29. }
  30. return $data;
  31. }
  32. public function delete($val, $unbuffered = false) {
  33. return ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered);
  34. }
  35. }
  36. ?>