Mysql 有关系的雄辩质疑

Mysql 有关系的雄辩质疑,mysql,laravel,laravel-4,eloquent,Mysql,Laravel,Laravel 4,Eloquent,所以我的问题很简单。我试图使用受约束的即时加载查询与另一个表有关系的表 但出于某种原因,约束条件不起作用 代码如下: $top_prospects = Player::with(array('statistic' => function($query){ $query->where('carrer_gp', '<=', 41); }))

所以我的问题很简单。我试图使用受约束的即时加载查询与另一个表有关系的表

但出于某种原因,约束条件不起作用

代码如下:

$top_prospects = Player::with(array('statistic' => function($query){
                                $query->where('carrer_gp', '<=', 41);
                    }))
                    ->where('rights', '<=', '30')
                    ->orderBy(DB::raw('floor(potentiel)+(consistency/10)'), 'desc')
                    ->take(25)
                    ->paginate(5,array('players.id','name','main_position','age','rights','country','potentiel','consistency'));
$top\u prospects=Player::with(数组('statistic'=>函数($query){

$query->where('carrer\u gp','检查你雄辩的关系模型(hasOne、hasMany、belognsTo等)。你能更具体一点吗?你期望发生什么,实际发生了什么?我希望看到所有有权选择拥有carrer\u gp的玩家