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

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

    <bdo id='UcX0u'></bdo><ul id='UcX0u'></ul>

    <tfoot id='UcX0u'></tfoot>

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

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

      2. Laravel Eloquent 使用 Where In? 查詢 JSON 列

        Laravel Eloquent query JSON column with Where In?(Laravel Eloquent 使用 Where In? 查詢 JSON 列)
      3. <i id='qHAbX'><tr id='qHAbX'><dt id='qHAbX'><q id='qHAbX'><span id='qHAbX'><b id='qHAbX'><form id='qHAbX'><ins id='qHAbX'></ins><ul id='qHAbX'></ul><sub id='qHAbX'></sub></form><legend id='qHAbX'></legend><bdo id='qHAbX'><pre id='qHAbX'><center id='qHAbX'></center></pre></bdo></b><th id='qHAbX'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='qHAbX'><tfoot id='qHAbX'></tfoot><dl id='qHAbX'><fieldset id='qHAbX'></fieldset></dl></div>

        1. <tfoot id='qHAbX'></tfoot>
            <bdo id='qHAbX'></bdo><ul id='qHAbX'></ul>
              <tbody id='qHAbX'></tbody>
            1. <legend id='qHAbX'><style id='qHAbX'><dir id='qHAbX'><q id='qHAbX'></q></dir></style></legend>

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

                  本文介紹了Laravel Eloquent 使用 Where In? 查詢 JSON 列的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我在查詢 json 列時(shí)遇到問題.

                  I am having trouble querying a json column.

                  以前我的代碼是

                  $query->whereIn('user', $users);
                  

                  現(xiàn)在我已將 db 類型更改為 JSON 列,并且正在嘗試修改新版本的代碼.

                  Now i have changed the db type to JSON column and am trying to modify the code for the new version.

                  在 RAW MYSQL 中這是有效的

                  In RAW MYSQL this works

                  JSON_CONTAINS(user, '"tom","Bill"') 
                  

                  但是當(dāng)我把它放在 eloquent/php 中時(shí),它一直失敗或返回注釋.在這里,我傳入了一組用戶,之前使用的是在原始 SQL 中工作的 WhereIn

                  But when i put it in eloquent / php it keeps failing or returning noting. Here i am passing in an array of Users, previous using an WhereIn which works in raw SQL

                  $leads->whereRaw("JSON_CONTAINS(user, '"$users"')")
                  

                  任何想法如何使它在 Laravel 中工作,以便我可以傳入一個(gè)字符串?dāng)?shù)組,并針對包含一個(gè)字符串?dāng)?shù)組的 json 列查詢它們.

                  Any idea how to make it work in Laravel so i can pass in an array of strings, query them against the json column which contains an array of strings too.

                  我的 Json 列有這樣的數(shù)據(jù)

                  My Json colum has data like so

                  ["Paul", "Tom", "Bob"]
                  

                  推薦答案

                  MySQL 需要一個(gè) JSON 字符串:

                  MySQL expects a JSON string:

                  $leads->whereRaw('JSON_CONTAINS(user, ?)', [json_encode($users)])
                  

                  在 Laravel 5.6.24 中你可以使用 whereJsonContains():

                  In Laravel 5.6.24 you can use whereJsonContains():

                  $leads->whereJsonContains('user', $users)
                  

                  這篇關(guān)于Laravel Eloquent 使用 Where In? 查詢 JSON 列的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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準(zhǔn)備好的語句amp;foreach 循環(huán))
                  Is mysqli_insert_id() gets record from whole server or from same user?(mysqli_insert_id() 是從整個(gè)服務(wù)器還是從同一用戶獲取記錄?)
                  PHP MySQLi doesn#39;t recognize login info(PHP MySQLi 無法識別登錄信息)
                  mysqli_select_db() expects exactly 2 parameters(mysqli_select_db() 需要 2 個(gè)參數(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的訪問被拒絕)
                    <tbody id='VMfhd'></tbody>
                  <tfoot id='VMfhd'></tfoot>
                  <i id='VMfhd'><tr id='VMfhd'><dt id='VMfhd'><q id='VMfhd'><span id='VMfhd'><b id='VMfhd'><form id='VMfhd'><ins id='VMfhd'></ins><ul id='VMfhd'></ul><sub id='VMfhd'></sub></form><legend id='VMfhd'></legend><bdo id='VMfhd'><pre id='VMfhd'><center id='VMfhd'></center></pre></bdo></b><th id='VMfhd'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='VMfhd'><tfoot id='VMfhd'></tfoot><dl id='VMfhd'><fieldset id='VMfhd'></fieldset></dl></div>

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

                        <bdo id='VMfhd'></bdo><ul id='VMfhd'></ul>

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

                            主站蜘蛛池模板: 精品视频在线一区 | 红桃视频一区二区三区免费 | 毛片一级网站 | 亚洲精品视 | 欧美黄色片在线观看 | 精品久久久久久久久久久 | 欧美一级二级在线观看 | 一区二区三区高清 | 日日夜夜91 | 亚洲另类视频 | 理伦毛片| 福利网址 | 日韩一区二区在线视频 | 日韩二区三区 | 欧美日韩精品专区 | 成人精品在线视频 | www.99热这里只有精品 | 老熟女毛片 | 狠狠干2020 | 超碰人人人 | 国产综合久久 | 日日夜夜草| 一区二区三区成人 | 精品91久久| 逼逼网| 天天草天天射 | 伊人婷婷| 56pao在线| 国产精品久久 | 国产一级一级毛片 | 亚洲免费高清 | 国产精品嫩草影院精东 | 中文字幕一区二区三区四区五区 | 中文字幕成人网 | 成人在线视频免费观看 | 国产一区精品 | 欧美成人精品在线 | 97日韩精品 | 成人网在线观看 | 99精品久久 | 亚洲精品久久国产高清情趣图文 |