2017-04-06 23 views
1

このクエリは正しい値ではないことを返します。雄弁またはWhere句を使用したクエリ

すべては> $ query-までうまくいっている( 'valid_licence_id'、 '1')が、私は追加します。

- >( 'statut_licence_id'、 '4') - > orWhere(」 statut_licence_id '、' 1 ');

「valid_licence_id = 3であり、1ではない」という結果が表示されます。誰か今ここで私は間違っている?おかげで事前にたくさん

$licencies = Licencies::where(['structure_id' => Auth::user()->structure->id]) 
      ->where(function ($query) { 
       $query->where('valid_licence_id', '1') 
       ->where('statut_licence_id' , '4') 
       ->orWhere('statut_licence_id' , '1'); 
      })->orderBy('created_at', 'DESC')->paginate(10); 
     return view('licencie/notConfirmed', compact('licencies')); 

答えて

3

場閉鎖のうち、この

->where('valid_licence_id', '1') 

->where('valid_licence_id', '1') 
->where(function ($query) { 
    $query->where('statut_licence_id' , '4') 
    ->orWhere('statut_licence_id' , '1'); 
})->orderBy('created_at', 'DESC')->paginate(10); 
+0

ありがとうChief !!!!!!!問題が解決しました –

+0

こんにちは@MathieuMourareau私は助けてうれしいです。私の答えに印を付けることを忘れないでください。ありがとう:) – EddyTheDove

関連する問題