• <small id='5BXEB'></small><noframes id='5BXEB'>

  • <legend id='5BXEB'><style id='5BXEB'><dir id='5BXEB'><q id='5BXEB'></q></dir></style></legend>

    <tfoot id='5BXEB'></tfoot>

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

        WhereNotExists Laravel Eloquent

        时间:2023-09-23

          <tbody id='NWvBf'></tbody>
        <tfoot id='NWvBf'></tfoot>

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

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

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

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

                  本文介绍了WhereNotExists Laravel Eloquent的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  laravel 的雄辩框架有点小麻烦.

                  Little bit of trouble with the eloquent framework for laravel.

                  我需要复制这样的查询:

                  I need to replicate a query like this :

                  SELECT *
                  FROM RepairJob
                  WHERE NOT EXISTS (SELECT repair_job_id
                      FROM DismissedRequest
                      WHERE RepairJob.id = DismissedRequest.repair_job_id);
                  

                  现在我有

                   $repairJobs = RepairJob::with('repairJobPhoto', 'city', 'vehicle')->where('active', '=', 'Y')->whereNotExists('id', [DismissedRequest::all('repair_job_id')])->get();
                  

                  有人有什么想法吗?我需要获取在已驳回请求表中没有记录的所有维修作业

                  Anyone an idea? I need to get all the repairjobs where there is no record for in the dismissed requests table

                  使用上述查询时出现此错误

                  I get this error when using the query above

                  Argument 1 passed to IlluminateDatabaseQueryBuilder::whereNotExists() must be an instance of Closure, string given
                  

                  推荐答案

                  尝试 dontHave() 方法.假设dismissedRequests"作为 RepairJob 模型中的关系名称.

                  Try doesntHave() method. Assuming 'dismissedRequests' as relation name in RepairJob model.

                  $jobs = RepairJob::with('repairJobPhoto', 'city', 'vehicle')
                      ->where('active', 'Y')->doesntHave('dismissedRequests')->get();
                  

                  这篇关于WhereNotExists Laravel Eloquent的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:什么是 WhereHas Laravel 中的关系计数条件 下一篇:Laravel/Eloquent:致命错误:在非对象上调用成员函数

                  相关文章

                  最新文章

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

                • <tfoot id='GQKAB'></tfoot>
                • <small id='GQKAB'></small><noframes id='GQKAB'>

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