www.gusucode.com > 高端企业门户+论坛网站源码程序 > 整站安装/整站源码/source/plugin/wechat/table/table_mobile_wechat_authcode.php

    <?php

/**
 *      [Discuz!] (C)2001-2099 Comsenz Inc.
 *      This is NOT a freeware, use is subject to license terms
 *
 *      $Id: table_mobile_wechat_authcode.php 34479 2014-05-07 00:40:10Z nemohou $
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

class table_mobile_wechat_authcode extends discuz_table {

	public function __construct() {
		$this->_table = 'mobile_wechat_authcode';
		$this->_pk = 'sid';

		parent::__construct();
	}

	public function fetch_by_code($code) {
		return DB::fetch_first('SELECT * FROM %t WHERE code=%d', array($this->_table, $code));
	}

	public function delete_history() {
		$time = TIMESTAMP - 3600;
		return DB::delete($this->_table, "createtime<$time");
	}

}