123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace Cas\Dao;
- use KIF\Dao\DBAgileDev;
- use KIF\Verify;
- use KIF\Dao\SqlHelper;
- class LotteryData extends DBAgileDev {
- protected $tableName = 'lottery_data';
-
-
- protected $other_field = array(
- 'events_id',
- 'prize_id',
- 'uid',
- 'scratch_receive',
- 'winning_time',
- 'winners_time',
-
- 'audit',
-
- 'platform_id',
- );
-
-
-
- const EVENT_SCRATCH_RECEIVE_TRUE = 1;
-
- const EVENT_SCRATCH_RECEIVE_FALSE = 2;
-
-
- public static $scratchReceive= array(
- self::EVENT_SCRATCH_RECEIVE_TRUE => array(
- 'desc' => '刮刮卡奖品:用户已领取',
- 'kw' => 'EVENT_SCRATCH_RECEIVE_TRUE',
- ),
- self::EVENT_SCRATCH_RECEIVE_FALSE => array(
- 'desc' => '刮刮卡奖品:用户未领取',
- 'kw' => 'EVENT_SCRATCH_RECEIVE_FALSE',
- ),
- );
-
-
- public static function getScratchReceive() {
- return self::$scratchReceive;
- }
-
-
-
- public function getTodayHasWinTotal($prize_id){
- $total = 0;
- if (!Verify::unsignedInt($prize_id)) {
- return $total;
- }
-
- $condition = array(
- 'prize_id' => $prize_id,
- 'create_time' => SqlHelper::addCompareOperator('>=', mktime(0,0,0)),
- );
- $result = $this->findBy($condition, null, null, "count(*)");
- return array_pop(array_pop($result));
- }
-
-
-
-
- }
|