• <optgroup id="JBKpu"><hgroup id="JBKpu"><i id="JBKpu"><table id="JBKpu"><figcaption id="JBKpu"><em id="JBKpu"><tr id="JBKpu"></tr></em><sup id="JBKpu"></sup><mark id="JBKpu"></mark></figcaption><acronym id="JBKpu"></acronym></table></i></hgroup></optgroup>
    <input id="JBKpu"><i id="JBKpu"></i></input>

      <canvas id="JBKpu"><input id="JBKpu"><datalist id="JBKpu"><span id="JBKpu"><select id="JBKpu"></select></span></datalist></input><tfoot id="JBKpu"><li id="JBKpu"><samp id="JBKpu"><textarea id="JBKpu"><strike id="JBKpu"><th id="JBKpu"><dt id="JBKpu"><rt id="JBKpu"><section id="JBKpu"></section><colgroup id="JBKpu"></colgroup><bdo id="JBKpu"></bdo></rt><sub id="JBKpu"></sub><abbr id="JBKpu"><legend id="JBKpu"><param id="JBKpu"></param></legend></abbr></dt><tr id="JBKpu"></tr></th></strike></textarea></samp></li></tfoot><kbd id="JBKpu"><audio id="JBKpu"><kbd id="JBKpu"><optgroup id="JBKpu"><area id="JBKpu"></area></optgroup></kbd></audio></kbd><tfoot id="JBKpu"><dt id="JBKpu"><cite id="JBKpu"></cite><hgroup id="JBKpu"><dl id="JBKpu"></dl></hgroup></dt></tfoot><link id="JBKpu"></link></canvas><style id="JBKpu"></style>

      1. <param id="JBKpu"></param><legend id="JBKpu"><em id="JBKpu"><rp id="JBKpu"><option id="JBKpu"><section id="JBKpu"><td id="JBKpu"></td></section><b id="JBKpu"></b></option></rp><em id="JBKpu"><strong id="JBKpu"><sup id="JBKpu"></sup></strong></em></em></legend>
        <strong id="JBKpu"><form id="JBKpu"><table id="JBKpu"><dl id="JBKpu"></dl></table><embed id="JBKpu"></embed><th id="JBKpu"></th></form><audio id="JBKpu"></audio></strong>
      2. <em id="JBKpu"><label id="JBKpu"></label></em><ul id="JBKpu"></ul>

        建议增加关联查询的空字段判断

        浏览:1487 发布日期:2019/12/16
        使用版本为thinkphp5.1.36版本

        业务出现特殊需求,需要在order表中通过一个send_id字段关联send表中相关数据,并且send_id字段可能为空。如果使用hasOne或者BelongsTo直接进行关联,则框架会报出异常

        解决方法:在think\model\relation\HasOne.php文件下的eagerlyOne函数,增加对$result->$localKey是否为空的判断,如果为空则不进行数据添加即可解决。BelongsTo同理
        评论(
        后面还有条评论,点击查看>>