table_common_mailcron.php 1.3 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_mailcron.php 27806 2012-02-15 03:20:46Z svn_project_zhangjie $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_common_mailcron extends discuz_table
  12. {
  13. public function __construct() {
  14. $this->_table = 'common_mailcron';
  15. $this->_pk = 'cid';
  16. parent::__construct();
  17. }
  18. public function delete_by_touid($touids) {
  19. if(empty($touids)) {
  20. return false;
  21. }
  22. return DB::query('DELETE FROM mc, mq USING %t AS mc, %t AS mq WHERE mc.'.DB::field('touid', $touids).' AND mc.cid=mq.cid',
  23. array($this->_table, 'common_mailqueue'), false, true);
  24. }
  25. public function fetch_all_by_email($email, $start, $limit) {
  26. return DB::fetch_all('SELECT * FROM %t WHERE email=%s '.DB::limit($start, $limit), array($this->_table, $email));
  27. }
  28. public function fetch_all_by_touid($touid, $start, $limit) {
  29. return DB::fetch_all('SELECT * FROM %t WHERE touid=%d '.DB::limit($start, $limit), array($this->_table, $touid));
  30. }
  31. public function fetch_all_by_sendtime($sendtime, $start, $limit) {
  32. return DB::fetch_all('SELECT * FROM %t WHERE sendtime<=%d ORDER BY sendtime '.DB::limit($start, $limit), array($this->_table, $sendtime));
  33. }
  34. }
  35. ?>