Laravel's Eloquent ORM query condition is sorted by a certain field in descending order
给我你的怀抱
给我你的怀抱 2017-05-16 16:56:06
0
2
700
$product = Product::all()->take(50);

Query 50 pieces of data. How to sort by a certain field in descending order

给我你的怀抱
给我你的怀抱

reply all(2)
phpcn_u1582

$product = Product::where([])->orderBy('created_at','desc')->skip($pos)->take($limit)->get();

大家讲道理

After reading your two recent questions, they were both because I didn’t read the document~~

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