我有一张表,我在其中保存语言的记录 ID ( language_skills_selected)。现在,我需要为每个项目获取名称。我将名称保存在 table 中language_skills。
这是我的变量和每个人的dd:
$data['user_test'] = DB::table('language_skills_selected')->where('user_id', $id)->get();
Language: 22 - Level: Intermediate
Language: 41 - Level: Beginner
Language: 13 - Level: Expert
Language: 35 - Level: Expert
Language: 23 - Level: Intermediate
在这里我有名字的变量: $data['language_skills'] = \App\LanguageSkill::lists('language_skill','id');
{"1":"Albanian","2":"Arabic","3":"Bengali","4":"Belarus","5":"Bulgarian","6":"Czech","7":"Chinese","8":"Korean","9":"Croatian","10":"Danish","11":"Hebraic","12":"English","13":"Estonian","14":"Finnish","15":"French","16":"German","17":"Greek","18":"Hindi","19":"Icelandic","20":"Italian","21":"Japanese","22":"Latvian","23":"Lithuanian","24":"Macedonian","25":"Hungarian","26":"Norwegian","27":"Dutch","28":"Persian","29":"Polish","30":"Portuguese","31":"Romanian","32":"Russian","33":"Serbian","34":"Slovak","35":"Slovene","36":"Spanish","37":"Swedish","38":"Thai","39":"Turkish","40":"Ukrainian","41":"Other"}
所以,而不是这些 id,我需要有语言名称 - 例如:Language: Bulgarian - Level : Expert
白衣染霜花
qq_花开花谢_0
手掌心