LARAVEL - 来自 SAME url 的响应,显示不同的结果

LARAVEL - Response from SAME url, showing different results

更新 1

@lukepolo 发现在JS中23842515550750742这个数字总是随机到23842515550750744。有什么想法吗?


我正在使用 Laravel 作为我正在创建的 API。我正在使用 Forge 运行 服务器。

当我在Chrome、Safari、FireFox等界面拉一个URL时,是return一个增加了2的ID。当我通过 cURL 等在 Postman、CRUD、Terminal 中拉出相同的 url 请求,它 return 是正确的响应。

邮递员的结果:

accountid: 1334372826597482
campaign:"Facebook"
campaignid: 23842515550750742 <-- CORRECT
client_id: 72
id: 817

来自 Chrome 的结果:

accountid:1334372826597482
campaign:"Facebook"
campaignid:23842515550750744 <-- INCORRECT
client_id:72
id:817

我正在使用 Facebook 营销 API 在本地保存信息,因此我可以 运行 以比他们 API 更快的响应速度进行大量查询。以下是用于列出具有基本信息的活动的代码:

    $this->parseRequestData($request);
    $campaigns = FacebookPerformanceOverview::whereIn('client_id', $this->sheet_ids)
        ->whereIn('accountid', $this->accountIds['facebook'])
        ->whereIn('campaignid', $this->campaigns)
        ->whereBetween('date', [$this->start_date, $this->end_date])
        ->groupBy('campaignid')
        ->get();
    $response = [];
    foreach ($campaigns AS $campaign) {
        $data = FacebookPerformanceOverview::whereIn('client_id', $this->sheet_ids)
            ->whereIn('accountid', $this->accountIds['facebook'])
            ->where('campaignid', $campaign->campaignid)
            ->whereIn('adsetid', $this->adsets)
            ->whereBetween('date', [$this->start_date, $this->end_date]);
        $response[] = array(
            'company' => $campaign->company,
            'campaign' => FacebookCampaignSettings::where('campaignid', $campaign->campaignid)->first(),
            'impressions' => $data->sum('impressions'),
            'clicks' => $data->sum('clicks'),
            'cost' => $data->sum('cost'),
            'reach' => $data->sum('reach'),
            'frequency' => $data->avg('frequency'),
            'uniqueclicks' => $data->sum('uniqueclicks'),
            'actions' => $data->sum('actions'),
            'offsiteconversions' => $data->sum('offsiteconversions'),
            'leads' => $data->sum('actionsleadgen') + $this->calculateLeads(),
        );
    }
    return response()->json($response, 200, [], JSON_NUMERIC_CHECK);

我无法提供 URL,因为它包含敏感信息,但我对发生的事情感到困惑。我已经清除了缓存、不同的浏览器、不同的计算机等。Web 浏览器总是 return 网络选项卡中的 ID 不正确。有什么想法吗?

Javascript not parsing large number in JSON correctly

就是答案。