• <tfoot id='PxXYz'></tfoot>

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

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

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

        • <bdo id='PxXYz'></bdo><ul id='PxXYz'></ul>
      1. Yii CDbCriteria 加入

        Yii CDbCriteria Join(Yii CDbCriteria 加入)

          <small id='5JGv0'></small><noframes id='5JGv0'>

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

                • <bdo id='5JGv0'></bdo><ul id='5JGv0'></ul>
                    <tbody id='5JGv0'></tbody>
                  本文介绍了Yii CDbCriteria 加入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我如何编写查询

                  SELECT *
                    FROM doc_docs dd 
                    JOIN doc_access da 
                      ON dd.id=da.doc_id 
                     AND da.user_id=7
                  

                  使用CDbCriteria 语法?

                  推荐答案

                  你实际上不能完全写出来,因为你必须将标准应用到 activerecord 模型来获取主表,但假设你有一个 DocDocs 模型你可以做像这样:

                  You actually cant completely write that since you have to apply the criteria to an activerecord model to obtain the primary table, but assuming you have a DocDocs model you can do it like this:

                  $oDBC = new CDbCriteria();
                  $oDBC->join = 'LEFT JOIN doc_access a ON t.id = a.doc_id and a.user_id = 7'; 
                  
                  $aRecords = DocDocs::model()->findAll($oDBC);
                  

                  虽然如果您为 DocDocs 模型提供与 doc_access 的关系可能会容易得多,但您不必使用 dbcriteria:

                  Although it might be a lot easier if you give your DocDocs model a relation with doc_access, then you don't have to use the dbcriteria:

                  class DocDocs extends CActiveRecord
                  {
                     ... 
                  
                     public function relations()
                     {
                        return array('access' => array(self::HAS_MANY, 'DocAccess', 'doc_id');
                     }
                  
                     ...
                  }
                  
                  $oDocDocs = new DocDocs;
                  $oDocDocs->id = 7;
                  $aRecords = $oDocDocs->access;
                  

                  应该给你一个很好的想法如何开始......

                  Should give you a fairly good idea how to start...

                  这篇关于Yii CDbCriteria 加入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  <legend id='NMFhr'><style id='NMFhr'><dir id='NMFhr'><q id='NMFhr'></q></dir></style></legend>
                      • <tfoot id='NMFhr'></tfoot>

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

                              <tbody id='NMFhr'></tbody>

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