gpt4 book ai didi

mysql - Laravel 查询 - 执行查询时 Laravel 似乎在每个字母之间添加 ?/空格

转载 作者:行者123 更新时间:2023-11-29 16:41:16 25 4
gpt4 key购买 nike

country_code 中选择 code,其中 country = '?U?n?i?t?e?d? ?K?i?n?g?d?o?m' 按国家/地区 asc 限制 1

排序
public function location_test(){

$locations = DB::table('accesses')
->select('country' ,DB::raw('count(*) as count'))
->join('ip2c_cache', 'accesses.ip', '=', 'ip2c_cache.ip')
->where('showcase_id', 5613)->groupby('country')
->get();

$mapData = "";
$locationData = array();

foreach ($locations as $location) {

$code = DB::table('country_code')
->select('code')->where('country', $location->country)
->orderBy('country')
->first();

$mapData = $mapData . '"' . $code->id . '":"' . $location->count . '",';
}
return $mapData;
}

最佳答案

当我更改数据库的排序规则时问题已解决

关于mysql - Laravel 查询 - 执行查询时 Laravel 似乎在每个字母之间添加 ?/空格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53320417/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com