答案 0 :(得分:1)
类似的东西:
Stocks::where('shop_id', $client_id)
->where(function ($query) use ($client_id, $ware_cd) {
$query->where('ware_id',
DB::raw(
'select ware_id from t_ware where shop_id=' . $client_id . ' and ware_cd=' . $ware_cd
)
);
})
->distinct()
->get();