<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國際加速解決方案。 廣告
                ## 加載頁面 ``` ~~~ <div class="info_items" > {foreach name="infos" item="value" } <div class="item_one"> <a target="_blank" href="/d{$value['id']}"> <div> <img class="cate_img" src="{$value['cate_image']}" alt=""> <img class="intro_img" src="{$value['thumb_image']}" alt=""> <p class="title">{$value['title']}</p> </div> <div class="intro"> {$value['desc']} </div> <div class="intro_user">{$value['user_name']}</div> <div class="detail_info"> <button class="detail_btn"> 查看詳情 </button> </div> </a> </div> {/foreach} <input type="hidden" id="more_div"> </div> <input type="hidden" id="offect" value="10" /> <!--加載狀態--> <div class="no-more" id="show_more">沒有更多了</div> ~~~ ``` ## 頁面下拉觸發事件 ~~~ $(window).scroll( function() { var scrollTop = $(this).scrollTop(); var scrollHeight = $(document).height(); var windowHeight = $(this).height(); if (scrollTop + windowHeight == scrollHeight) { $("#show_more").html('數據加載中'); var offect = $("#offect").val(); var search_val = $(".search_val").text(); var mm = location.href; var?index?=?mm?.lastIndexOf("\/"); var str??=?mm?.substring(index?,?mm?.length); var url = str; $.post(url,{offect:offect}, function(data){ console.log(data); if(data != -1){ var to_array = eval("("+data+")"); var str = ""; console.log(to_array); for(var p in to_array){ str += '<div class="item_one">\n' + ' <a href="d'+to_array[p].id+'">\n' + ' <div>\n' + ' <img class="cate_img" src="'+to_array[p].cate_image+'"alt="">\n' + '\n' + ' <img class="intro_img" src="'+to_array[p].thumb_image+ '"alt="">\n' + ' <p class="title">'+to_array[p].title+'</p>\n' + ' </div>\n' + ' <div class="intro">'+to_array[p].desc+'</div>\n' + ' <div class="intro_user">'+to_array[p].user_name+'</div>\n' + ' <div class="detail_info">\n' + ' <button class="detail_btn">\n' + ' 查看詳情\n' + ' </button>\n' + ' </div>\n' + ' </a>\n' + ' </div>\n'; } $("#offect").val(offect*1+10); $("#more_div").before(str); }else{ $("#show_more").html('沒有更多數據了'); } }, 'json'); } }); ~~~ ## 控制器偏移分頁 ``` ~~~ public function index() { $cates = Db::name('category')->where('status', '=', 'normal')->where('pid', "neq", '0')->order('weigh desc')->field('id,name,type')->select(); $category_id = isset($_GET['id']) ? $_GET['id'] : ''; $this->assignconfig('category_id', $category_id); $where['status_switch']=['=','1']; //$where['recom_ids']=['in',"'".]; //輪播圖 $recm_id = Db::name("recom")->where('recom_name','like','%輪播圖%')->field('id,recom_name')->find(); $map[]=['exp',Db::raw('FIND_IN_SET('.$recm_id['id'].',recom_ids)')]; $lunbo = Db::name('artical')->where($map)->where('status_switch','=',1)->field('id,thumb_image')->order(['weigh' => 'desc', 'create_time' => 'desc'])->limit(5)->select(); //中間部分 $mid_id = Db::name("recom")->where('recom_name','like','%最新最熱%')->field('id,recom_name')->find(); $map2[]=['exp',Db::raw('FIND_IN_SET('.$mid_id['id'].',recom_ids)')]; $middle = Db::name('artical')->where($map2)->where('status_switch','=',1)->field('id,title')->order(['weigh' => 'desc', 'create_time' => 'desc'])->limit(14)->select(); //右側圖片 $right_id = Db::name("recom")->where('recom_name','like','%首頁右側圖片%')->field('id,recom_name')->find(); $map3[]=['exp',Db::raw('FIND_IN_SET('.$right_id['id'].',recom_ids)')]; $right_image = Db::name('artical')->where($map3)->where('status_switch','=',1)->field('id,thumb_image,title')->order(['weigh' => 'desc', 'create_time' => 'desc'])->limit(3)->select(); //右側標題欄 $right_title01 = Db::name("recom")->where('recom_name','like','%頭條%')->field('id,recom_name')->find(); $map4[]=['exp',Db::raw('FIND_IN_SET('.$right_title01['id'].',recom_ids)')]; $right_title_info01 = Db::name('artical')->where($map4)->where('status_switch','=',1)->field('id,title')->order(['weigh' => 'desc', 'create_time' => 'desc'])->limit(4)->select(); $right_title02 = Db::name("recom")->where('recom_name','like','%相關%')->field('id,recom_name')->find(); $map5[]=['exp',Db::raw('FIND_IN_SET('.$right_title02['id'].',recom_ids)')]; $right_title_info02 = Db::name('artical')->where($map5)->where('status_switch','=',1)->field('id,thumb_image,title')->order(['weigh' => 'desc', 'create_time' => 'desc'])->limit(4)->select(); $right_title03 = Db::name("recom")->where('recom_name','like','%推薦%')->field('id,recom_name')->find(); $map6[]=['exp',Db::raw('FIND_IN_SET('.$right_title03['id'].',recom_ids)')]; $right_title_info03 = Db::name('artical')->where($map6)->where('status_switch','=',1)->field('id,thumb_image,title')->order(['weigh' => 'desc', 'create_time' => 'desc'])->limit(4)->select(); $offect = isset($_POST['offect']) ? $_POST['offect'] : 0; $infos = Db::name('artical')->where('status_switch','=',1)->field('admin_id,mark,status_switch', true)->order(['weigh' => 'desc', 'id' => 'desc'])->limit($offect, 10)->select(); foreach ($infos as &$v) { $user = Db::name('user')->where('id', '=', $v['user_id'])->field('username')->find(); $cate = Db::name('category')->where('id', '=', $v['category_id'])->field('id,name,image')->find(); $v['user_name'] = $user['username']; $v['cate_name'] = $cate['name']; $v['cate_image'] = $cate['image']; } if (isset($_POST['offect'])) { if (!empty($infos)) { return json_encode($infos); die; } else { return -1; die; } } $this->assign([ 'lunbo'=>$lunbo, 'middle'=>$middle, 'right_image'=>$right_image, 'right_title_info01'=>$right_title_info01, 'right_title_info02'=>$right_title_info02, 'right_title_info03'=>$right_title_info03, 'infos'=>$infos ]); return $this->view->fetch(); } ~~~ ``` ## ``` ## 搜索功能 ``` ~~~ public function search($keyword ='' ,$search_word = '') { $where = []; $keywords = ''; if ($keyword !='') { $_GET['keywords'] = $keyword; $keywords = $_GET['keywords']; $where['tag'] = ['like', "%" . $keywords . "%"]; } if ($search_word!='') { $_GET['search_keyword'] = $search_word; $keywords = $_GET['search_keyword']; $where['tag|title'] = ['like', "%" . $keywords . "%"]; //$where['title'] = ['like',"%".$search_keyword."%"]; } $where['status_switch'] = ['=', '1']; $offect = isset($_POST['offect']) ? $_POST['offect'] : 0; $infos = Db::name('artical')->where($where)->field('admin_id,mark,status_switch', true)->order(['weigh' => 'desc', 'id' => 'desc'])->limit($offect, 10)->select(); foreach ($infos as &$v) { $user = Db::name('user')->where('id', '=', $v['user_id'])->field('username')->find(); $cate = Db::name('category')->where('id', '=', $v['category_id'])->field('id,name,image')->find(); $v['user_name'] = $user['username']; $v['cate_name'] = $cate['name']; $v['cate_image'] = $cate['image']; } if (isset($_POST['offect'])) { if (!empty($infos)) { return json_encode($infos); die; } else { return -1; die; } } $this->view->assign('keywords', $keywords); $this->view->assign('infos', $infos); return $this->view->fetch(); } ~~~ ```
                  <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>

                              哎呀哎呀视频在线观看