【发布时间】:2020-09-12 19:31:48
【问题描述】:
我有这个 post_views 表
created_at post_id ip
========== ======= =======
01-01-2020 3 127.0.0.1
01-01 2020 5 127.0.0.1
02-01 2020 5 127.0.0.1
03-01 2020 5 222.33.44.55
06-02 2020 3 222.33.44.55
06-02 2020 3 127.0.0.1
10-02 2020 5 33.44.55.66
02-03 2020 3 22.33.65.22
02-03 2020 3 22.33.65.22
02-03 2020 5 11.44.55.66
我需要总结每天的访问量,以获得使用此表的 3 个上个月的总网页浏览量,我的意思是这个结果:
January= 3 visits
February = 3 visits
March = 2 visits
【问题讨论】:
-
你可以使用
whereMonthlaravel.com/docs/7.x/queries#where-clauses
标签: php laravel laravel-5 eloquent