table_mobile_wechat_authcode.php 711 B

1234567891011121314151617181920212223242526272829303132
  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_mobile_wechat_authcode.php 34479 2014-05-07 00:40:10Z nemohou $
  7. */
  8. if(!defined('IN_DISCUZ')) {
  9. exit('Access Denied');
  10. }
  11. class table_mobile_wechat_authcode extends discuz_table {
  12. public function __construct() {
  13. $this->_table = 'mobile_wechat_authcode';
  14. $this->_pk = 'sid';
  15. parent::__construct();
  16. }
  17. public function fetch_by_code($code) {
  18. return DB::fetch_first('SELECT * FROM %t WHERE code=%d', array($this->_table, $code));
  19. }
  20. public function delete_history() {
  21. $time = TIMESTAMP - 3600;
  22. return DB::delete($this->_table, "createtime<$time");
  23. }
  24. }