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); } public function getUserParticipateLogNumGroupByUidDate($eventsId, $start, $end){ $returnNum = 0; $sql = "SELECT count(uid) FROM `{$this->tableName}` WHERE events_id={$eventsId} and create_time >= ".$start." and create_time <= ".$end." GROUP BY uid "; $tmpResult = $this->db->fetchAll($sql); if (!$tmpResult) { return $returnNum; } return count($tmpResult); } }