whereIn('goods_id', $goodsIds)->with(['hasOneMini'=>function($query){ $query->select('member_id','openid'); }])->get(); $this->goodsBuy = empty($goods) ? [] : $goods->toArray(); } }