_table = 'common_member_field_home'; $this->_pk = 'uid'; $this->_pre_cache_key = 'common_member_field_home_'; parent::__construct(); } public function increase($uids, $creditarr) { $uids = array_map('intval', (array)$uids); $sql = array(); $allowkey = array('addsize', 'addfriend'); foreach($creditarr as $key => $value) { if(($value = intval($value)) && in_array($key, $allowkey)) { $sql[] = "`$key`=`$key`+'$value'"; } } if(!empty($sql)){ DB::query("UPDATE ".DB::table($this->_table)." SET ".implode(',', $sql)." WHERE uid IN (".dimplode($uids).")", 'UNBUFFERED'); $this->increase_cache($uids, $creditarr); } } } ?>