function resourcePut($api, $tools, $param) { $param['fbId'] = $tools->sql_injection_anti($_SESSION["fbId"]); $param['act'] = $tools->sql_injection_anti($_POST["act"]); if ($param["fbId"] == "" or $param['act'] == "") { $api->setError("資料不齊全,請重新輸入。"); return; } include_once "../../library/Table/User.class.php"; $user = new user(); include_once "../../library/Table/LogActFinish.class.php"; $logActFinish = new LogActFinish(); $userData = $user->getByFbId($param['fbId']); if (empty($userData)) { //session_destroy(); $api->setError("查無此玩家資料!"); } else { $max = $user->actMax($param['act']); $user->updateActByFbId($param['act'], 1, $param['fbId']); switch ($param["act"]) { case "act1": $param['log'] = "A"; break; case "act2": $param['log'] = "B"; break; case "act3": $param['log'] = "C"; break; case "act4": $param['log'] = "D"; break; case "act5": $param['log'] = "E"; break; case "act6": $param['log'] = "F"; break; } $logActFinish->add($param); $api->setOutput("加入粉絲團成功"); } return; }
include_once LIB_PATH . 'Table/LogClick.class.php'; include_once LIB_PATH . 'Table/LogLike.class.php'; include_once LIB_PATH . 'Table/Game.class.php'; include_once LIB_PATH . 'Table/LogActStart.class.php'; include_once LIB_PATH . 'Table/LogActFinish.class.php'; include_once LIB_PATH . 'Table/LogInviteFriend.class.php'; 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); // 因為此活動而進入遊戲的人數