从字典,内容提供商,Android获取字词

时间:2016-11-07 20:51:06

标签: android mysql dictionary android-contentprovider

我这样做是为了从字典中获取包含我传递给函数的字符串的所有单词:

    $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);

结果始终为空Cursor。

我做错了什么?

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。

代码是正确的,问题是我的个人词典是空的。

我期待设备使用他自己的字典或类似的东西。

要在Android中访问您的个人词典,您需要执行以下操作:

Settings > Idiom > Personal dictionary 

在那里你可以编辑,删除,添加......单词。

这是在我的Android设备中执行此操作的方法,也许您的设备不同。