回答編集履歴
2
修正
test
CHANGED
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
->when(count($words), function ($query) use ($words) {
|
36
36
|
|
37
|
-
$query->where(function($query){
|
37
|
+
$query->where(function($query) use ($words) {
|
38
38
|
|
39
39
|
foreach ($words as $word) {
|
40
40
|
|
1
修正
test
CHANGED
@@ -34,17 +34,21 @@
|
|
34
34
|
|
35
35
|
->when(count($words), function ($query) use ($words) {
|
36
36
|
|
37
|
-
|
37
|
+
$query->where(function($query){
|
38
38
|
|
39
|
-
$
|
39
|
+
foreach ($words as $word) {
|
40
40
|
|
41
|
-
->
|
41
|
+
$query->where('title', 'like', '%' . $word . '%')
|
42
42
|
|
43
|
-
->orWhere('
|
43
|
+
->orWhere('target_site', 'like', '%' . $word . '%')
|
44
44
|
|
45
|
-
->orWhere('c
|
45
|
+
->orWhere('content', 'like', '%' . $word . '%')
|
46
46
|
|
47
|
+
->orWhere('created_at', 'like', '%' . $word . '%');
|
48
|
+
|
47
|
-
}
|
49
|
+
}
|
50
|
+
|
51
|
+
})
|
48
52
|
|
49
53
|
})
|
50
54
|
|