久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='uTYso'></tfoot>
      <bdo id='uTYso'></bdo><ul id='uTYso'></ul>
  • <legend id='uTYso'><style id='uTYso'><dir id='uTYso'><q id='uTYso'></q></dir></style></legend>

    1. <i id='uTYso'><tr id='uTYso'><dt id='uTYso'><q id='uTYso'><span id='uTYso'><b id='uTYso'><form id='uTYso'><ins id='uTYso'></ins><ul id='uTYso'></ul><sub id='uTYso'></sub></form><legend id='uTYso'></legend><bdo id='uTYso'><pre id='uTYso'><center id='uTYso'></center></pre></bdo></b><th id='uTYso'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uTYso'><tfoot id='uTYso'></tfoot><dl id='uTYso'><fieldset id='uTYso'></fieldset></dl></div>

      1. <small id='uTYso'></small><noframes id='uTYso'>

        Laravel Eloquent orWhere 查詢

        Laravel Eloquent orWhere Query(Laravel Eloquent orWhere 查詢)
        <tfoot id='hsPuC'></tfoot>
          1. <small id='hsPuC'></small><noframes id='hsPuC'>

            • <bdo id='hsPuC'></bdo><ul id='hsPuC'></ul>

                <tbody id='hsPuC'></tbody>
            • <i id='hsPuC'><tr id='hsPuC'><dt id='hsPuC'><q id='hsPuC'><span id='hsPuC'><b id='hsPuC'><form id='hsPuC'><ins id='hsPuC'></ins><ul id='hsPuC'></ul><sub id='hsPuC'></sub></form><legend id='hsPuC'></legend><bdo id='hsPuC'><pre id='hsPuC'><center id='hsPuC'></center></pre></bdo></b><th id='hsPuC'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hsPuC'><tfoot id='hsPuC'></tfoot><dl id='hsPuC'><fieldset id='hsPuC'></fieldset></dl></div>

                  <legend id='hsPuC'><style id='hsPuC'><dir id='hsPuC'><q id='hsPuC'></q></dir></style></legend>
                • 本文介紹了Laravel Eloquent orWhere 查詢的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  誰能告訴我如何用 Eloquent 編寫這個查詢?

                  Can someone show me how to write this query in Eloquent?

                  SELECT * FROM `projects` WHERE `id`='17' OR `id`='19'
                  

                  我在想

                  Project::where('id','=','17')
                          ->orWhere('id','=','19')
                          ->get();
                  

                  在這種情況下,我的變量(17 和 19)也來自多選框,所以基本上是在一個數組中.關于如何循環并動態添加這些 where/orWhere 子句的任何線索?

                  Also my variables (17 and 19) in this case are coming from a multi select box, so basically in an array. Any clues on how to cycle through that and add these where/orWhere clauses dynamically?

                  謝謝.

                  推薦答案

                  您可以通過三種方式進行.假設你有一個

                  You could do in three ways. Assume you've an array in the form

                  ['myselect' =>[11, 15, 17, 19], 'otherfield' =>'測試', '_token' =>'jahduwlsbw91ihp'] 可能是 Input::all();

                     Project::where(function ($query) {
                        foreach(Input::get('myselect') as $select) {
                           $query->orWhere('id', '=', $select);
                        }
                     })->get();
                  

                •    Project::whereIn('id', Input::get('myselect'))->get();
                  

                •    $sql = DB::table('projects');
                     foreach (Input::get('myselect') as $select) {
                         $sql->orWhere('id', '=', $select);
                     }
                     $result = $sql->get();
                  

                • 這篇關于Laravel Eloquent orWhere 查詢的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)
                      <tbody id='889V2'></tbody>

                    <small id='889V2'></small><noframes id='889V2'>

                  • <tfoot id='889V2'></tfoot>
                      • <bdo id='889V2'></bdo><ul id='889V2'></ul>
                        1. <legend id='889V2'><style id='889V2'><dir id='889V2'><q id='889V2'></q></dir></style></legend>
                          <i id='889V2'><tr id='889V2'><dt id='889V2'><q id='889V2'><span id='889V2'><b id='889V2'><form id='889V2'><ins id='889V2'></ins><ul id='889V2'></ul><sub id='889V2'></sub></form><legend id='889V2'></legend><bdo id='889V2'><pre id='889V2'><center id='889V2'></center></pre></bdo></b><th id='889V2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='889V2'><tfoot id='889V2'></tfoot><dl id='889V2'><fieldset id='889V2'></fieldset></dl></div>

                            主站蜘蛛池模板: 一区二区三区免费观看 | 日韩插插 | 婷婷久 | 亚洲人精品 | 国产综合精品 | av看看| 99精品国产一区二区三区 | 成人午夜激情 | 在线欧美视频 | 国产探花在线观看视频 | 亚洲精品一区二区网址 | 国内精品视频一区二区三区 | 一级片在线播放 | 99精品免费久久久久久久久日本 | 久久天堂 | 欧美精品一区二区三区蜜桃视频 | 久久久九九 | 天天躁天天操 | 亚洲大片在线观看 | 国产精品乱码一二三区的特点 | 欧美综合久久 | 亚洲三级av | 久久久久国 | 国产精品九九九 | 日本在线中文 | 高清黄色| 永久免费视频 | 欧美久久视频 | 久久久久香蕉视频 | 一级免费毛片 | www.99热 | 国产一区在线视频 | 成人黄色三级毛片 | 人人看人人草 | 成人动漫视频网站 | 国产精品精品久久久 | 国产成人免费在线 | 国产日产久久高清欧美一区 | 一区二区三区四区免费视频 | 99tv成人影院 | 亚洲狠狠爱一区二区三区 |