teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

ご質問の箇所を追記しました。

2019/07/17 10:53

投稿

YosukeOchi
YosukeOchi

スコア10

title CHANGED
File without changes
body CHANGED
@@ -66,4 +66,14 @@
66
66
  PHP 7.2.13
67
67
  MySQL 5.6
68
68
 
69
- 宜しくお願いいたします。
69
+ 宜しくお願いいたします。
70
+
71
+ ### 追記
72
+ ```Item
73
+ public function getItems($article)
74
+ {
75
+ $items_order = explode(",", $article->item_order);
76
+ $items_order_concat = implode(',', $items_order);
77
+ return Item::whereIn('id', $items_order)->orderByRaw("FIELD(id, $items_order_concat)")->get(); //エラーの箇所です
78
+ }
79
+ ```