laravel查询不到数据

$goods = GoodsModel::whereIn('goods.category_id', function ($query) use ($cate) {
$query->select('id')->from('goods_categories')->where('goods_categories.level_code', 'like', '%/' . $cate['id'] . '/%');
})
->leftJoin('goods_repertory','goods_repertory.goods_id','=','goods.id')
->leftJoin('goods_installment',function($join){

$join->on('goods_installment.goods_no','=','goods_repertory.id');
})
->leftJoin('goods_colors','goods_repertory.goods_color_id','=','goods_colors.id')
->leftJoin('goods_types','goods_repertory.goods_type_id','=','goods_types.id')

->whereNotNull('goods_installment.id')
->where('goods_installment.period','=','goods.max_period')
->take($get)
->get(
['goods.name','goods_colors.name as color_name','goods_types.name as type_name',
'goods_colors.id as color_id','goods_types.id as type_id',
'goods_installment.period','goods_installment.single_price',
'goods_installment.goods_price','goods_colors.pic']
)->toArray();

去掉 ->where('goods_installment.period','=','goods.max_period') 可以得到结果
不去掉就没有,本身是有'goods_installment.period','=','goods.max_period'返回的数据,不知道什么原因,
已邀请:

要回复问题请先登录注册