| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 | <?phpnamespace 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' 	);			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);	}	}
 |