質問編集履歴
3
詳細な情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,8 +16,34 @@
|
|
16
16
|
|
17
17
|
![product_views_table](51f57d91ee33c2a0ee63a8d921bbe521.png)
|
18
18
|
|
19
|
+
MySQLのバージョンは、5.7.26 です。
|
20
|
+
|
19
21
|
|
20
22
|
|
21
23
|
この子テーブルを使って、商品ごとの1ヶ月以内の閲覧数ランキングを作りたいのですが
|
22
24
|
|
23
25
|
やり方がさっぱりわからなくて、ご教示いただけると幸いです。
|
26
|
+
|
27
|
+
|
28
|
+
|
29
|
+
repository.php
|
30
|
+
|
31
|
+
```
|
32
|
+
|
33
|
+
$query = $search->getQuery()
|
34
|
+
|
35
|
+
->select(
|
36
|
+
|
37
|
+
'product_views.product_id'
|
38
|
+
|
39
|
+
)
|
40
|
+
|
41
|
+
->groupBy(
|
42
|
+
|
43
|
+
'product_views.product_id'
|
44
|
+
|
45
|
+
)
|
46
|
+
|
47
|
+
->join('product_views', 'products.id', '=', 'product_views.product_id')
|
48
|
+
|
49
|
+
```
|
2
修正
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
詳細な情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,6 +14,10 @@
|
|
14
14
|
|
15
15
|
|
16
16
|
|
17
|
+
![product_views_table](51f57d91ee33c2a0ee63a8d921bbe521.png)
|
18
|
+
|
19
|
+
|
20
|
+
|
17
21
|
この子テーブルを使って、商品ごとの1ヶ月以内の閲覧数ランキングを作りたいのですが
|
18
22
|
|
19
23
|
やり方がさっぱりわからなくて、ご教示いただけると幸いです。
|