<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                * [ ] 功能 * 根據兩個或多個表中的列之間的關系關聯,從這些表中查詢數據 * 支持多次連貫調用 * [ ] join 方法參數 * 四個參數: * $data,關聯的表數組 * $type,關聯類型,可選值有: | 可選值 | 說明 | | :---: | :---: | | table | 連表,不需要關聯條件,默認為 table | | left | 左連接,需要關聯條件 | | right | 右連接,需要關聯條件 | | inner | 內連接,等值連接,需要關聯條件 | * $where,關聯條件,默認為空數組 * $orand,關聯條件的關系,默認為 and * 場景: user 數據庫 user_class 表 | class_id | class_name | | :---: | :---: | | 1 | 一班 | | 2 | 二班 | | 3 | 三班 | user_account 表 | uid | username | class_id | | :---: | :---: | :---: | | 1 | 張三 | 1 | | 2 | 李四 | 2 | | 3 | 隔壁老王 | 1 | * 用法一:關聯表不寫別名,那么關聯表就要寫完整表名 ~~~ // 關聯表 $data = array( 'user_account', 'user_class', ); // 關聯類型 $type = 'left'; // 關聯條件 $join_where = array( 'user_account.class_id[.=]' => 'user_class.class_id', ); // 關聯條件的關系 $orand = 'and'; // 查詢條件 $where = array( 'user_class.class_name' => '二班', ); // 關聯查詢 $data = mysql\User::join( $data, $type, $join_where, $orand )->where( $where )->select(); ~~~ 執行的 sql 語句: ~~~ select?*?from??user_account?left?join?user_class?on?user_account.class_id?=?user_class.class_id?where?user_class.class_name?=?'二班' ~~~ 查詢結果: ~~~ array( array( 'uid' => 2, 'username' => '李四', 'class_id' => 2, 'class_name' => '二班', ), ); ~~~ * 用法二:關聯表寫別名,表名不用帶表前綴 ~~~ // 關聯表 // 定義表別名 // user_account 定義別名為 a // user_class 定義別名為 c $data = array( 'a[true]' => 'user_account', 'c[true]' => 'user_class', ); // 關聯類型 $type = 'left'; // 關聯條件 $join_where = array( 'a.class_id[.=]' => 'c.class_id', ); // 關聯條件的關系 $orand = 'and'; // 查詢條件 $where = array( 'c.class_name' => '二班', ); // 關聯查詢 $data = mysql\User::join( $data, $type, $join_where, $orand )->where( $where )->select(); ~~~ 執行的 sql 語句: ~~~ select?*?from??user.user_account?as?a?left?join?user.user_class?as?c?on?a.class_id?=?c.class_id?where?c.class_name?=?'二班'; ~~~ 查詢結果: ~~~ array( array( 'uid' => 2, 'username' => '李四', 'class_id' => 2, 'class_name' => '二班', ), ); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看