table_home_docomment.php 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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_home_docomment.php 27819 2012-02-15 05:12:23Z svn_project_zhangjie $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_home_docomment extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'home_docomment';
  15. $this->_pk = 'id';
  16. parent::__construct();
  17. }
  18. public function delete_by_doid_uid($doids = null, $uids = null) {
  19. $sql = array();
  20. $doids && $sql[] = DB::field('doid', $doids);
  21. $uids && $sql[] = DB::field('uid', $uids);
  22. if($sql) {
  23. return DB::query('DELETE FROM %t WHERE %i', array($this->_table, implode(' OR ', $sql)));
  24. } else {
  25. return false;
  26. }
  27. }
  28. public function fetch_all_by_doid($doids) {
  29. if(empty($doids)) {
  30. return array();
  31. }
  32. return DB::fetch_all('SELECT * FROM %t WHERE '.DB::field('doid', $doids).' ORDER BY dateline', array($this->_table));
  33. }
  34. }
  35. ?>