<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國際加速解決方案。 廣告
                ## 通過欄目查找文章 /** * [getBottomArticleCategory 通過欄目查找文章] * @param [string] $cid [欄目ID] * @return [string] [返回文章] */ function getBottomArticleCategory($cid){ //1,通過對象獲取文章 $field = 'a.*,b.id AS post_category_id,b.list_order,b.category_id'; $join = [ ['__PORTAL_CATEGORY_POST__ b', 'a.id = b.post_id'] ]; $portalPostModel = new PortalPostModel(); $articles = $portalPostModel->alias('a')->field($field)->join($join) ->where(function($query) use ($cid) { $category = $cid; if (!empty($category)) { $query->where('b.category_id','in',$category); } }) ->order('update_time', 'DESC') ->select(); //2,轉成數組處理 $arr=json_decode(json_encode($articles),true); foreach ($arr as $key => $val) { $url = cmf_url('portal/Article/index', ['id' => $val['id']], true, true); $nr ="<li><a href=".$url." target='_blank'>" .$val['post_title']."</a></li>"; echo $nr; } } 這里是使用對象來查詢數據,具體也是拼接sql的方法獲取,看不懂的話,執行下面SQL就明白了: SELECT a.*,b.id AS post_category_id,b.list_order,b.category_id FROM wys_portal_post AS a INNER JOIN wys_portal_category_post AS b ON a.id = b.post_id WHERE b.category_id IN (41) ORDER BY update_time DESC 通過中間表查詢當前文章,category_id(欄目ID)可以有多個,后面是轉成數組再遍歷輸出。 在模板里面調用 <ul class="clearfix"> <php>getBottomArticleCategory(41);</php> </ul>
                  <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>

                              哎呀哎呀视频在线观看