Laravel whereMonth 查询问题?
我希望使用whereMonth来查询相对应的数据 可是结果不如我所愿
// Laravel5.7
$lastMonthVisitor = StatisticsUserModel::query()
->whereMonth('statistics_time',8) // 我准备查询8月份的数据
->sum('new_create_visitor_user');
print_r($lastMonthVisitor);
数据库分别存储了两条数据
statistics_time列
2022-08-01
2021-08-01
new_create_visitor_user列
26
52
whereYear是不是应该加上 :joy: