我在Laravel CONCAT上遇到了一个问题,它没有连接数据库字段。当我检查返回的数据时,它没有 fullName
public function getAllPlayers()
{
$data = Player::select(DB::raw('CONCAT(familyName," ",firstName) AS fullName'))
->orderBy('familyName', 'asc')
->join('teams', 'players.primaryClubId', '=', 'teams.clubId')
->select(['players.*', 'teams.teamName', 'teams.teamNickname', 'teams.teamCode'])
->get()
->unique() //remove duplicates
->groupBy(function($item, $key) { //group familyName that starts in same letter
return substr($item['familyName'], 0, 1);
})
->map(function ($subCollection) {
return $subCollection->chunk(4); // put your group size
});
return $data;
}
答案 0 :(得分:1)
您正在使用其他hadoop distcp hdfs://localhost:8020/LEARN hdfs://cloudera.hadoop:8020/Test
覆盖select
。要添加多个选择,您需要使用select
方法。
addSelect