123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- <?php
- namespace Cas\Dao;
- use KIF\Dao\DBAgileDev;
- use KIF\Verify;
- use KIF\Dao\SqlHelper;
- /**
- *
- * 获奖数据表
- *
- * @author lihuanchun@qq.com
- *
- */
- class LotteryData extends DBAgileDev {
- protected $tableName = 'lottery_data';
-
- /**
- * 数据库里的真实字段
- * @var array
- */
- protected $other_field = array(
- 'events_id',
- 'prize_id',
- 'uid',
- 'scratch_receive',// 对刮挂卡领取奖品的特殊处理
- 'winning_time',
- 'winners_time',
- # 审核字段 1未审核 2审核通过 3审核不通过 默认为审核通过2
- 'audit',
- # 平台id 适用于多个平台下的领取记录
- 'platform_id',
- );
-
-
- /**
- * EVENT_SCRATCH_RECEIVE_TRUE 关于刮挂卡活动领取状态:用户已领取
- * @var int
- */
- const EVENT_SCRATCH_RECEIVE_TRUE = 1;
- /**
- * EVENT_SCRATCH_RECEIVE_FALSE 关于刮挂卡活动领取状态:用户未领取
- * @var int
- */
- 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',
- ),
- );
-
- /**
- * 关于刮挂卡活动领取状态
- * @return array
- */
- 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));
- }
-
-
-
-
- }
|