简体   繁体   English

您好,如何根据 ID 在一列中显示 2 条记录?

[英]Hello, how can I show 2 record in one column based on ID?

在此处输入图像描述

Example, I want to show in column: 12144 = 6, 13例如,我想在列中显示:12144 = 6, 13

What should I do?我应该怎么办? Thanks, hope you're help me!谢谢,希望你能帮到我!

you can change the role_id data type to TEXT or JSON and add a cast to it您可以将role_id数据类型更改为 TEXT 或 JSON 并向其添加演员表

protected $cast=['role_id'=>'array'];

see more https://laravel.com/docs/5.8/eloquent-mutators#array-and-json-casting查看更多https://laravel.com/docs/5.8/eloquent-mutators#array-and-json-casting

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM