实际上,我需要从表中获取一些特定数据,ID的范围为1-5。如何获得此数据?
$products = Products::with('products_images')
->select(['id','title','price','slug'])
->where('id',1,2,3)
->get();
实际上,我需要从表中获取一些特定数据,ID的范围为1-5。如何获得此数据?
$products = Products::with('products_images')
->select(['id','title','price','slug'])
->where('id',1,2,3)
->get();
通常在SQL中,其工作方式如下:
SELECT * FROM `tablename` WHERE `id` > 1000 AND `id` < 2000
关于汤姆