1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace Cas\Dao;
- use KIF\Dao\DBAgileDev;
- use KIF\Core\Request;
- use KIF\Cache\Memcached;
- /**
- *
- * 活动[用户收集字母信息]
- *
- * @author lihuanchun@qq.com
- *
- */
- class LotteryEventsLetters extends DBAgileDev {
- protected $tableName = 'lottery_events_letters';
-
-
- /**
- * 数据库里的真实字段
- * @var array
- */
- protected $other_field = array(
- 'events_id',
- 'ABC_name',
- 'img_1',
- 'img_2',
- 'num'
- );
-
- public function getEventData($events_id){
- $condition = array('events_id' => $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;
-
- }
-
-
-
-
- }
|