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

        <legend id='iaauR'><style id='iaauR'><dir id='iaauR'><q id='iaauR'></q></dir></style></legend>
      1. <small id='iaauR'></small><noframes id='iaauR'>

      2. <tfoot id='iaauR'></tfoot>

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

        如何让 Laravel Eloquent “IN"询问?

        时间:2023-09-24

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

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

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

                <legend id='lPQzW'><style id='lPQzW'><dir id='lPQzW'><q id='lPQzW'></q></dir></style></legend>
                  <tbody id='lPQzW'></tbody>
                • 本文介绍了如何让 Laravel Eloquent “IN"询问?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我想在 Laravel Eloquent 中进行查询,就像这里的原始 MySQL 查询

                  I want to make query in Laravel Eloquent like here its raw MySQL query

                  SELECT  * from  exampleTbl where id in(1,2,3,4)
                  

                  我在 Laravel Eloquent 中尝试过这个,但它不起作用

                  I have tried this in Laravel Eloquent but it's not working

                  DB::where("id IN(23,25)")->get()
                  

                  推荐答案

                  这是你在 Eloquent 中的做法

                  Here is how you do in Eloquent

                  $users = User::whereIn('id', array(1, 2, 3))->get();
                  

                  如果您使用的是查询构建器,则:

                  And if you are using Query builder then :

                  $users = DB::table('users')->whereIn('id', array(1, 2, 3))->get();
                  

                  这篇关于如何让 Laravel Eloquent “IN"询问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:Laravel Eloquent:访问属性和动态表名 下一篇:Eloquent Laravel 模型上的 __construct

                  相关文章

                  最新文章

                  <tfoot id='CvJcS'></tfoot>

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

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

                    1. <legend id='CvJcS'><style id='CvJcS'><dir id='CvJcS'><q id='CvJcS'></q></dir></style></legend>