Beispiel #1
0
function resourceGet($api, $tools, $param)
{
    $param["fbId"] = $tools->sql_injection_anti($_SESSION["fbId"]);
    $param["list"] = empty($_POST["list"]) ? 0 : $tools->sql_injection_anti($_POST["list"]);
    include_once "../../library/Table/User.class.php";
    $user = new User();
    $userData = $user->getByFbId($param['fbId']);
    if (empty($userData)) {
        $api->setError("查無玩家資料!");
        unset($userData, $user, $param);
        return;
    } else {
        include_once "../../library/Table/Friend.class.php";
        $friend = new Friend();
        $invite = $friend->getGameNum($param['fbId']);
        $list = $friend->listFriend($param['fbId']);
        if ($param["list"]) {
            $api->setOutput("取得好友人數", array("list" => $list));
        } else {
            $api->setOutput("取得好友人數", array("num" => count($invite)));
        }
        unset($list, $invite);
    }
    unset($userData, $friend, $user, $param);
    reuturn;
}