Beispiel #1
0
include_once LIB_PATH . 'Table/Lottery.class.php';
include_once LIB_PATH . 'Table/User.class.php';
$logClick = new LogClick();
$result_log = $logClick->listClickLog();
if (!empty($result_log)) {
    $logLike = new LogLike();
    $tbGame = new Game();
    $logActStart = new LogActStart();
    $logActFinish = new LogActFinish();
    $logInviteFriend = new LogInviteFriend();
    $tbLottery = new Lottery();
    $tbUser = new User();
    foreach ($result_log as $key => $value) {
        $tempRow = $value;
        // 按讚人數
        $countLike = $logLike->countLikeLogByDate($tempRow['log_date']);
        $tempRow["count_like"] = $countLike;
        // 確認進入遊戲人數
        // $countGameUser = $tbGame->countGameUserByDate($tempRow['log_date']);
        // $tempRow["count_game_user"] = $countGameUser;
        $listGameUser = $tbGame->listGameUserByDate($tempRow['log_date']);
        if (!empty($listGameUser) and is_array($listGameUser)) {
            $tempRow["count_game_user"] = count($listGameUser);
            // 因為此活動而進入遊戲的人數
            $tempRow["count_already_join"] = 0;
            $gameUserArray = array();
            foreach ($listGameUser as $value) {
                $checkUserAlreadyJoin = $tbUser->checkUserAlreadyJoin($value["fb_id"]);
                if ($checkUserAlreadyJoin) {
                    $tempRow["count_already_join"] = $tempRow["count_already_join"] + 1;
                }