get($activityId); if ($brainstorming["start_time"] <= time()) { return 1; } else { return 0; } } /** * @param $activityId * @return bool */ public function isReachEndTime($activityId) { $brainstorming = BrainstormingService::getInstance()->get($activityId); $endTime = $brainstorming["end_time"]; $now = time(); if ($endTime > 0 && $now > $endTime) { return true; } return false; } /** * @param $activityId * @return bool */ public function isCanGame($activityId,$userId) { $brainstorming = BrainstormingService::getInstance()->get($activityId); $user = UserService::getInstance()->getUser($userId); $startTime = $brainstorming["start_time"]; $endTime = $brainstorming["end_time"]; $now = time(); if ($startTime > 0 && $now < $startTime && $user["is_white_list"]==0) { return false; } if ($endTime > 0 && $now > $endTime) { return false; } return true; } }