【发布时间】:2021-11-07 10:03:27
【问题描述】:
在数据库中我有数据:表:product
id name order created_ad
1 Iphone 3 2019-01-12 06:17:26
2 Samsung 2 2019-01-12 04:05:30
3 Xiaomi 1 2019-01-12 09:07:02
4 Master 4 2020-06-05 09:17:12
5 Macbook 3 2020-08-11 14:04:20
我的控制器ProductController.php
public function index()
{
$product = Product::select('id', 'name', 'created_at')->where('created_at', '2019-01-12')->get()->toArray();
dd($product);
}
返回结果是一个空数组!
现在我想获取日期2019-01-12 的所有数据,我该怎么做?谢谢。
【问题讨论】: