table_common_member_field_home_archive.php 1.1 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_common_member_field_home_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_field_home_archive extends table_common_member_field_home
  12. {
  13. public function __construct() {
  14. parent::__construct();
  15. $this->_table = 'common_member_field_home_archive';
  16. $this->_pk = 'uid';
  17. }
  18. public function fetch($id){
  19. return ($id = dintval($id)) ? DB::fetch_first('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $id)) : array();
  20. }
  21. public function fetch_all($ids) {
  22. $data = array();
  23. if(($ids = dintval($ids, true))) {
  24. $query = DB::query('SELECT * FROM '.DB::table($this->_table).' WHERE '.DB::field($this->_pk, $ids));
  25. while($value = DB::fetch($query)) {
  26. $data[$value[$this->_pk]] = $value;
  27. }
  28. }
  29. return $data;
  30. }
  31. public function delete($val, $unbuffered = false) {
  32. return ($val = dintval($val, true)) && DB::delete($this->_table, DB::field($this->_pk, $val), null, $unbuffered);
  33. }
  34. }
  35. ?>