Explorar el Código

240624-1428-Kim

hokky hace 5 meses
padre
commit
0c8a11a523

+ 3 - 4
pro/app/Http/Controllers/IndexController.php

@@ -52,8 +52,7 @@ class IndexController extends Controller
 
         // dd($mainSiseList);
         // 유튜브
-        $query = "(post_type_id = 40 or post_type_id = 43 or post_type_id = 46)  and status ='1'";
-        // $query = "post_type_id = 40 or post_type_id = 43 or post_type_id = 46 and status ='1'";
+        $query = "(post_type_id = 40 or post_type_id = 43 or post_type_id = 46) and status ='1' and pt1 !=''";
         $limit = (int)request('limit', 12);
         $page = (int)request('page', 1);
         $mainYoutubeList = $this->callApiService->callApi([
@@ -181,7 +180,7 @@ class IndexController extends Controller
     {
         $query = "post_type_id = 40 or post_type_id = 43 or post_type_id = 46 and status ='2'";
         $offset = (int) $request->query('offset', 0);
-        $limit = (int) $request->query('limit', 5);
+        $limit = (int) $request->query('limit', 12);
 
         $mainYoutubeList=$this->callApiService->callApi([
             'url' => 'post-page',
@@ -207,7 +206,7 @@ class IndexController extends Controller
     {
         $query = "post_type_id = 41 or post_type_id = 44 or post_type_id = 50  and status ='2'";
         $offset = (int) $request->query('offset', 0);
-        $limit = (int) $request->query('limit', 5);
+        $limit = (int) $request->query('limit', 12);
 
         $moreBlogList=$this->callApiService->callApi([
             'url' => 'post-page',

+ 7 - 9
pro/resources/views/index.blade.php

@@ -140,10 +140,6 @@ $(document).ready(function() {
     changeSiseListByDefault(currentSiseType);
 	$('.main-header').addClass('main_header');
 	$('.main-header .logo img').attr("src", "/themes/kbgolf/pro/resources/images/logo_wh.png");
-    console.log('mainSiseList : ', mainSiseList);
-    console.log('mainYoutubeList : ', mainYoutubeList);
-    console.log('mainBlogList : ', mainBlogList);
-
 });
 
 // siseType별로 tbody 생성
@@ -157,16 +153,19 @@ function changeSiseList(e) {
     var filteredSiseList = mainSiseList.filter(function(mainsise) {
         return mainsise['Pc1'].includes(currentSiseType);
     });
-    console.log('filteredSiseList : ', filteredSiseList);
+
     renderMainSiseList(filteredSiseList);
+    // sise 더보기 버튼 list를 change할 때마다 활성화
+    $('.m_quote .btn_wrap .m_more').show();
 }
 // defalut 가져오기
 function changeSiseListByDefault(currentSiseType) {
-    console.log('default is golf');
     var filteredSiseList = mainSiseList.filter(function(mainsise) {
         return mainsise['Pc1'].includes(currentSiseType);
     });
     renderMainSiseList(filteredSiseList);
+    // sise 더보기 버튼 list를 change할 때마다 활성화
+    $('.m_quote .btn_wrap .m_more').show();
 }
 
 // tbody 생성
@@ -217,16 +216,15 @@ function renderMainSiseList(siseList){
     // 시세 더보기
     function loadMoreSise(){
         var offset = $('#sise-list tr').length;
-        console.log('offset : ', offset);
-        var limit = 3;
+        var limit = 12;
 
         $.ajax({
             url: '/load-more-sise',
             method: 'GET',
             data: { offset: offset, limit: limit, siseType: currentSiseType },
+
             success: function(response) {
                 var siseList = response.Page;
-
                 if (siseList!=null) {
                     appendMainSiseList(siseList);
                 } else {