i try to add appended column with Model::with
$pitchChech = Pitch::with(['prices'=>function ($query){
$query->select('*',\DB::Raw("(select sum(HOUR(TIMEDIFF(valid_to ,valid_from))) from pitch_price as xpitch_price where pitch_id = pitch_price.pitch_id ) as x "))
->whereRaw(" x < ?",[24]);
}])->get();
dd($pitchChech);
and i have this output
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'x' in 'where clause'
i can't understand what is the problem im using laravel 5.1 but i don't think there are problem with ut
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire