123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace Cas\Dao;
- use KIF\Dao\DBAgileDev;
- use KIF\Core\Request;
- use KIF\Cache\Memcached;
- /**
- *
- * 活动用户参与日志
- *
- * @author lihuanchun@qq.com
- *
- */
- class LotteryUserParticipateLog extends DBAgileDev {
- protected $tableName = 'lottery_user_participate_log';
-
- /**
- * 数据库里的真实字段
- *
- * @var array
- */
- protected $other_field = array (
- 'events_id',
- 'uid',
- # 审核字段 1未审核 2审核通过 3审核不通过
- 'audit',
- );
-
-
- public function findUserParticipateDataGroupByUid($eventsId,$limit=null){
-
- $sql = "SELECT uid,create_time FROM `{$this->tableName}` WHERE events_id={$eventsId} GROUP BY uid ";
- if($limit){
- $sql = "SELECT uid,create_time FROM `{$this->tableName}` WHERE events_id={$eventsId} GROUP BY uid limit {$limit} ";
- }
-
- $tmpResult = $this->db->fetchAll($sql);
- if (!$tmpResult) {
- return array();
- }
- return $tmpResult;
- }
-
-
- public function getUserParticipateLogNumGroupByUid($eventsId){
- $returnNum = 0;
- $sql = "SELECT count(uid) FROM `{$this->tableName}` WHERE events_id={$eventsId} GROUP BY uid ";
- $tmpResult = $this->db->fetchAll($sql);
- if (!$tmpResult) {
- return $returnNum;
- }
- return count($tmpResult);
- }
-
- }
|