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

  • <small id='UkCoq'></small><noframes id='UkCoq'>

      <tfoot id='UkCoq'></tfoot>

      <legend id='UkCoq'><style id='UkCoq'><dir id='UkCoq'><q id='UkCoq'></q></dir></style></legend>
        <bdo id='UkCoq'></bdo><ul id='UkCoq'></ul>

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

        Laravel whereIn whereJsonContains 的實現(xiàn)

        Laravel whereIn implementation of whereJsonContains(Laravel whereIn whereJsonContains 的實現(xiàn))

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

              <bdo id='IdcAw'></bdo><ul id='IdcAw'></ul>
              • <legend id='IdcAw'><style id='IdcAw'><dir id='IdcAw'><q id='IdcAw'></q></dir></style></legend>
                  <tbody id='IdcAw'></tbody>

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

                  <tfoot id='IdcAw'></tfoot>
                  本文介紹了Laravel whereIn whereJsonContains 的實現(xiàn)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有這段代碼可以正常工作并返回 1 個項目集合:

                  I have this code that works fine and returns 1 item collection:

                  $myCollection = MyModel::whereJsonContains('payload->ProductCode->id', "1")->get();
                  

                  但是,我不僅要在值為 1 時獲取 $myCollection,而且要在它包含在多個數(shù)組項之一中時獲取它.

                  I however want to fetch the $myCollection not just when the value is 1 but when it is contained in one of many array items.

                   $array = [0 => 1, 1 => 2, 2 => 3];
                   $myCollection = MyModel::whereJsonContains('payload->ProductCode->id', $array)->get();
                   
                  

                  更新當我嘗試此代碼時,它返回一個空數(shù)據(jù).我的意思是當我使用 1 而不是 1" 時.這可能是我使用數(shù)組時它不起作用的原因嗎?

                  UPDATES When I try this code it return an empty data. I mean when I use 1 instead of "1". Could that be the reason why it doesn't work when I use an array?

                  $myCollection = MyModel::whereJsonContains('payload->ProductCode->id', 1)->get();

                  有效載荷包含的示例如下.我想這可以讓我的問題更清晰:

                  A sample of what the payload contains is this. I suppose that could give more clarity to my question:

                  {
                      "ProductCode": {
                          "id": "1",
                          "name": "My Service",
                      }
                      
                  }

                  運行上面的代碼返回一個空數(shù)據(jù).請問我該如何解決?

                  Running the above code returns an empty data. How do I fix this please?

                  推薦答案

                  您需要按照以下方式查詢.

                  You need to follow your query as below.

                  $array = [0 => 1, 1 => 2, 2 => 3];
                  
                  // Eloquent
                  PaymentTransaction::whereJsonContains('payload->ProductCode->id',$array)->get();;
                  
                   // or
                  PaymentTransaction::jsonContains('payload->ProductCode->id', $array)->get();
                  

                  你也可以試試下面的方法.

                  you can try it as below too.

                  $array = [0 => 1, 1 => 2, 2 => 3];
                  $array = array_values(array_map('strval',$array));
                  PaymentTransaction::where(function ($query) use ($array) {
                     foreach ($array as $id) {
                         $query->orWhereJsonContains('payload->ProductCode->id', $id);
                     }
                  })->get();
                  

                  這篇關(guān)于Laravel whereIn whereJsonContains 的實現(xiàn)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

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

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

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

                          • 主站蜘蛛池模板: 波多野结衣电影一区 | 成人免费看黄网站在线观看 | 久久99久久99精品免视看婷婷 | 欧美成人h版在线观看 | 国产精品久久久久久久久免费 | japan21xxxxhd美女| 久久中文字幕一区 | 国产情侣在线看 | 国产精品1区2区3区 中文字幕一区二区三区四区 | 国产精品国产三级国产aⅴ中文 | 激情免费视频 | 91精品国产91久久久久久最新 | 99精品99久久久久久宅男 | 91青青草视频| 亚洲色图在线观看 | 欧美精品乱码久久久久久按摩 | 午夜视频在线免费观看 | 国产主播第一页 | 一级美国黄色片 | 亚洲人成人一区二区在线观看 | 国产精品精品视频一区二区三区 | 美女天天干天天操 | 欧美日韩综合一区 | 一区二区在线 | 亚洲国产精品第一区二区 | 99精彩视频 | 亚洲97| 黄色三级在线播放 | 成人二区| 国产精品久久久乱弄 | 免费黄色a级毛片 | 欧美精品一区二区三区四区 在线 | 亚洲香蕉在线视频 | 国产精品成人一区二区三区 | 国产精品欧美日韩 | 一级片片 | 免费的av| 一级爱爱片 | 凹凸日日摸日日碰夜夜 | jizz18国产 | 欧美综合在线视频 |