码迷,mamicode.com
首页 > 其他好文 > 详细

laravel with closure

时间:2018-06-11 15:42:43      阅读:128      评论:0      收藏:0      [点我收藏+]

标签:desc   fun   order   cts   _id   size   HERE   fir   function   

$product = $product->where(‘uuid‘, $uuid)->firstOrFail();

$affiliators = $affiliator->with([
‘affiliatorProducts‘ => function($query) use($product) {

$query->where(‘product_id‘, $product->id);
}])

->orderBy(‘id‘, ‘desc‘)
->paginate($pageSize, null, null, $currentPage);

laravel with closure

标签:desc   fun   order   cts   _id   size   HERE   fir   function   

原文地址:https://www.cnblogs.com/fengliang/p/9167140.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!