修复 主题查看数不更新问题

This commit is contained in:
stackia 2017-02-12 09:06:29 +08:00
parent 35c1df4c28
commit 5f90403eed
1 changed files with 3 additions and 1 deletions

View File

@ -20,7 +20,9 @@ class table_forum_threadaddviews extends discuz_table {
}
public function update_by_tid($tid) {
return DB::query('UPDATE %t SET `addviews`=`addviews`+1 WHERE tid=%d', array($this->_table, $tid));
$ret = DB::query('UPDATE %t SET `addviews`=`addviews`+1 WHERE tid=%d', array($this->_table, $tid));
$this->increase_cache(array($tid), array('addviews' => 1));
return $ret;
}
public function fetch_all_order_by_tid($start = 0, $limit = 0) {
return DB::fetch_all('SELECT * FROM %t ORDER BY tid'.DB::limit($start, $limit), array($this->_table), $this->_pk);