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

      <legend id='wGmE7'><style id='wGmE7'><dir id='wGmE7'><q id='wGmE7'></q></dir></style></legend>

        <small id='wGmE7'></small><noframes id='wGmE7'>

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

        Eloquent ORM laravel 5 獲取 id 數組

        Eloquent ORM laravel 5 Get Array of ids(Eloquent ORM laravel 5 獲取 id 數組)
          <tbody id='137Hd'></tbody>

        <small id='137Hd'></small><noframes id='137Hd'>

      2. <tfoot id='137Hd'></tfoot>

        1. <legend id='137Hd'><style id='137Hd'><dir id='137Hd'><q id='137Hd'></q></dir></style></legend>
              • <bdo id='137Hd'></bdo><ul id='137Hd'></ul>

                  <i id='137Hd'><tr id='137Hd'><dt id='137Hd'><q id='137Hd'><span id='137Hd'><b id='137Hd'><form id='137Hd'><ins id='137Hd'></ins><ul id='137Hd'></ul><sub id='137Hd'></sub></form><legend id='137Hd'></legend><bdo id='137Hd'><pre id='137Hd'><center id='137Hd'></center></pre></bdo></b><th id='137Hd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='137Hd'><tfoot id='137Hd'></tfoot><dl id='137Hd'><fieldset id='137Hd'></fieldset></dl></div>
                  本文介紹了Eloquent ORM laravel 5 獲取 id 數組的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我使用的是 Eloquent ORM laravel 5.1,我想返回一個大于 0 的 id 數組,我的模型叫做 test.

                  I'm using Eloquent ORM laravel 5.1, and I want to return an array of ids greater than 0, my model is called test.

                  我試過了:

                  $test=test::select('id')->where('id' ,'>' ,0)->get()->toarray();
                  

                  它返回:

                  Array ( [0] => Array ( [id] => 1 ) [1] => Array ( [id] => 2 ) )
                  

                  但我希望結果是這樣的簡單數組:

                  But I want the result to be in simple array like this:

                  Array ( 1,2 )
                  

                  推薦答案

                  你可以使用 lists() :

                  You could use lists() :

                  test::where('id' ,'>' ,0)->lists('id')->toArray();
                  

                  注意:最好以Studly Case格式定義模型,例如Test.

                  NOTE : Better if you define your models in Studly Case format, e.g Test.

                  您也可以使用 get():

                  test::where('id' ,'>' ,0)->get('id');
                  

                  <小時>

                  更新:(對于版本 >= 5.2)

                  lists() 方法在新版本 >= 5.2不推薦使用,現在你可以使用 pluck() 方法代替:

                  The lists() method was deprecated in the new versions >= 5.2, now you could use pluck() method instead :

                  test::where('id' ,'>' ,0)->pluck('id')->toArray();
                  

                  注意:如果您需要 string,例如在 blade 中,您可以使用沒有 toArray() 部分的函數,例如:

                  NOTE: If you need a string, for example in a blade, you can use function without the toArray() part, like:

                  test::where('id' ,'>' ,0)->pluck('id');
                  

                  這篇關于Eloquent ORM laravel 5 獲取 id 數組的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  MySQLi prepared statement amp; foreach loop(MySQLi準備好的語句amp;foreach 循環)
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個服務器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個參數)
                  Php mysql pdo query: fill up variable with query result(Php mysql pdo 查詢:用查詢結果填充變量)
                  MySQLI 28000/1045 Access denied for user #39;root#39;@#39;localhost#39;(MySQLI 28000/1045 用戶“root@“localhost的訪問被拒絕)
                  • <small id='Ya0oB'></small><noframes id='Ya0oB'>

                  • <legend id='Ya0oB'><style id='Ya0oB'><dir id='Ya0oB'><q id='Ya0oB'></q></dir></style></legend>

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

                    <tfoot id='Ya0oB'></tfoot>
                          <tbody id='Ya0oB'></tbody>
                          <bdo id='Ya0oB'></bdo><ul id='Ya0oB'></ul>
                            主站蜘蛛池模板: 免费的日批视频 | 亚洲欧美中文字幕在线观看 | 日韩欧美在线不卡 | 粉嫩在线| 色在线免费视频 | 日韩中文字幕一区 | 免费久 | 亚洲国产精选 | 精品国产伦一区二区三区观看体验 | 最新免费av网站 | 国产精品国产精品国产专区不卡 | 国产精品免费在线 | 一级毛片视频在线 | 一区二区三区精品在线视频 | 国产在线精品免费 | 久久国产精品72免费观看 | 日本精品国产 | 免费成人在线网 | 色网在线观看 | 婷婷精品| 91精品国产综合久久久久蜜臀 | 亚洲视频免费观看 | 成人妇女免费播放久久久 | 三级成人片| 精品乱人伦一区二区三区 | 久久久久久久久国产 | 国产精品久久久久久影院8一贰佰 | 国产精品国产精品国产专区不蜜 | 中文字幕免费在线 | 久久亚洲精品久久国产一区二区 | 国产精品久久久久久久7电影 | 男女视频在线观看 | 综合精品在线 | 91精品久久久久久久久中文字幕 | 亚洲电影一级片 | 精品人伦一区二区三区蜜桃网站 | 国产精品污www一区二区三区 | 蜜月aⅴ免费一区二区三区 99re在线视频 | 91综合网| 国产精品99久久久久久宅男 | 国产激情片在线观看 |