Example #1
0
 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;
             }
         }
         unset($gameUserArray);
     } else {
         $tempRow["count_game_user"] = 0;
         $tempRow["count_already_join"] = 0;
     }
     // 活動中,每關卡遊戲人數
     $countActStart = $logActStart->countActStartLogByDateAndAct($tempRow['log_date'], "A");
     $tempRow["count_act_start_a"] = $countActStart;
     $countActStart = $logActStart->countActStartLogByDateAndAct($tempRow['log_date'], "B");
     $tempRow["count_act_start_b"] = $countActStart;
     $countActStart = $logActStart->countActStartLogByDateAndAct($tempRow['log_date'], "C");