<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>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                #### **一.關聯統計** #### ***1.***使用withCount()方法,可以統計主表關聯附表的個數,輸出用profile\_count; $list = UserModel::withCount('profile')->all(\[1,2,3\]); //值得注意的是,比如withCount('profile')這個表,然后會有一個默認變量,profile\_count,這個數據就是統計的數據,這個是默認的,當然,也可以自定義 foreach($list as $user){ echo $user->profile\_count;//默認變量數據 } withCount(\['profile'=>'**ps**'\])->all(\[1,2,3\]); 這個ps就是自定義的統計變量了 #### ***2.***關聯統計的輸出采用"關聯方法名"\_count,這種結構輸出 #### ***3.***不單單支持Count,還有這些統計方法, withMax(),withMin(),withSum(),withAvg() #### ***4.***除了withhCount()不需要指定字段,其他的統計方法都需要指定字段 $list = UserModel::withSum('profile','status')->all(\[1,2,3\])
                  <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>

                              哎呀哎呀视频在线观看