<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國際加速解決方案。 廣告
                # 連貫操作 ORM提供的鏈式操作方法,可以有效的提高數據存取的代碼清晰度和開發效率。 ## where 你可以使用 where 方法。調用 where 最基本的方式是需要傳遞一個參數 這個參數可以傳遞多種不同表現: ### 主鍵 ~~~php // 主鍵 $user = UserListModel::create()->where(1)->get(); // 多個主鍵 $user = UserListModel::create()->where([1,2,3])->all(); ~~~ ### 數組 ~~~php // [字段名=> 字段值]數組方式 $user = UserListModel::create()->where(['state' => 1])->get(); // 復雜條件數組 $user = UserListModel::create()->where([ 'age' => [[18,23], 'between'], 'name' => ['siam', 'like', 'or'], ]) ~~~ ### 原生sql ~~~php $user = UserListModel::create()->where("sql 語句 需要自己注意注入風險")->get(); ~~~ ## alias alias用于設置當前數據表的別名 ~~~php $res = TestUserListModel::create()->alias('siam')->where(['siam.name' => 'test'])->all(); ~~~ ## group group 方法可以將結果分組。 ~~~php $group = TestUserListModel::create()->field('sum(age) as age, `name`')->group('name')->all(null); ~~~ ## order order 方法可用于將原生字符串設置為 order by 子句的值: ~~~php $order = TestUserListModel::create()->order('id', 'DESC')->get(); ~~~ ## join join通常有下面幾種類型,不同類型的join操作會影響返回的數據結果。 * INNER JOIN: 等同于 JOIN(默認的JOIN類型),如果表中有至少一個匹配,則返回行 * LEFT JOIN: 即使右表中沒有匹配,也從左表返回所有的行 * RIGHT JOIN: 即使左表中沒有匹配,也從右表返回所有的行 * FULL JOIN: 只要其中一個表中存在匹配,就返回行 ~~~php object join ( mixed $joinTable , string $joinCondition = null [, string $type = 'INNER'] ) ~~~ $joinTable 要關聯的(完整)表名以及別名 $joinCondition 關聯條件. $type 關聯類型。可以為:'LEFT', 'RIGHT', 'OUTER', 'INNER', 'LEFT OUTER', 'RIGHT OUTER', 'NATURAL',不區分大小寫,默認為INNER(數據庫軟件 默認)。 ~~~php $join = TestUserListModel::create()->join('table2','table2.col1 = user_list.col2')->get(); $join2 = TestUserListModel::create()->alias('list')->join('table2 as t2','t2.col1 = list.col2')->get(); ~~~
                  <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>

                              哎呀哎呀视频在线观看