laravel查询表中字段值相同的所有数据
例:我要查询partner表中,cellphone字段,所有相同值的数据
$phone = Partner::select('cellphone', DB::raw('COUNT(*) as count'))
->groupBy('cellphone')
->having('count', '>', 1)
->get();
return $phone;
laravel查询表中字段值相同的所有数据
例:我要查询partner表中,cellphone字段,所有相同值的数据
$phone = Partner::select('cellphone', DB::raw('COUNT(*) as count'))
->groupBy('cellphone')
->having('count', '>', 1)
->get();
return $phone;