其中uuid的条件在laravel中不起作用
我的其中()使用UUID的条件在Laravel中对我不起作用。
public function skills($id)
{
$skills = DB::table("industry_skill_sets")
->whereIn('industry_id', [$id])
->pluck("name", "id");
print_r($skills);
exit;
}
在这里,我的身份证是由逗号隔开的UUID。因此,当我回应ID时,我会得到以下内容。
2b5e5507-7e01-45fe-b0ed-331135479061,7c816e0f-d6e2-489c-bdce-df064b3e99f9
当我在其中的条件下使用此变量时,它会显示错误。
sqlstate [22P02]:无效文本表示:7错误:无效输入 类型UUID的语法: “ 2B5E5507-7E01-45FE-B0ED-331135479061,7C816E0F-D6E2-D6E2-489C-BDCE-DFCE-DF064B3E99F9”
我正在使用PostgreSQL作为数据库。
My whereIn()
condition using a UUID is not working for me in Laravel.
public function skills($id)
{
$skills = DB::table("industry_skill_sets")
->whereIn('industry_id', [$id])
->pluck("name", "id");
print_r($skills);
exit;
}
Here my id is the UUID separated by commas. So when I echo id, I am getting the following.
2b5e5507-7e01-45fe-b0ed-331135479061,7c816e0f-d6e2-489c-bdce-df064b3e99f9
When I use this variable in the WhereIn condition, It shows an error.
SQLSTATE[22P02]: Invalid text representation: 7 ERROR: invalid input
syntax for type uuid:
"2b5e5507-7e01-45fe-b0ed-331135479061,7c816e0f-d6e2-489c-bdce-df064b3e99f9"
I am using PostgreSQL as a database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
需要将UUID转换为字符串
Need's to convert UUID to string