Exemplo n.º 1
0
 public function delete_by_tid($tids)
 {
     parent::clear_cache($tids);
     if (!$tids) {
         return;
     }
     return DB::delete($this->_table, DB::field('tid', $tids));
 }
 public function update_voters($pid, $uid)
 {
     parent::clear_cache($pid);
     DB::query("UPDATE %t SET voters=voters+1, voterids=CONCAT(voterids, '%d\t') WHERE pid=%d", array($this->_table, $uid, $pid));
 }
 public function update_num($pid, $typeid)
 {
     parent::clear_cache($pid);
     $typename = $typeid == 1 ? 'support' : 'against';
     return DB::query('UPDATE %t SET ' . $typename . '=' . $typename . '+1, total=total+1 WHERE pid=%d', array($this->_table, $pid));
 }