$events_id); $ids = $this->findIdsBy($condition); $returnData = $this->gets($ids); return $returnData; } /** * 对已抽中的数量进行修改 */ public function upLettersWinningNum($id ,$num){ $data = $this->get($id); $info = array( 'winning_num' => $data['winning_num'] + $num ); return $this->modify($info,array('id' => $id)); } /** * 获取当天已经发放的数量 */ public function getTodayHasWinTotal($letters_id){ $thisTime = time(); $objMemcached = new Memcached(); $key = date('Y_m_d',$thisTime).'_'.$letters_id.'_is_winning_num'; $num = $objMemcached ->get($key); if(!$num){ $num = 0; } return $num; } /** * 累加 获取当天已经发放的数量 */ public function cumulativeTodayHasWinTotal($letters_id){ $thisTime = time(); $objMemcached = new Memcached(); $key = date('Y_m_d',$thisTime).'_'.$letters_id.'_is_winning_num'; $num = $objMemcached ->get($key); if(!$num){ $num = 1; }else{ $num ++; } $objMemcached ->set($key,$num,60 * 60 * 24); return $num; } }