How to use laravel between
怪我咯
怪我咯 2017-05-16 16:47:21
0
2
890

For example
To implement data query within a month
Then you should use between to calculate the time. How does laravel's ORM implement the between operation

$start = '开始时间';
$end = '结束时间';
$map['time'] = array('between' , array($start , $end));
User::where($map)->get();

The above code is invalid

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(2)
phpcn_u1582
User::whereBetween('created_at', [$start, $end]);

//or

User::where('created_at', '>=', $start)->where('created_at', '<=', $end);
小葫芦

$obj=Condition 1;
$obg=$obj->where();
$obg=$obj->where();
Just use this method

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template