Browse Source

240624-1406-Kim

hokky 5 months ago
parent
commit
edf43fe182

+ 1 - 68
erp/resources/views/popup/popup-form1/form-a/post/sise-form.blade.php

@@ -76,7 +76,6 @@
             });
 
             $('.sise-act').on('click', function () {
-                // console.log($(this).data('value'))
                 switch( $(this).data('value') ) {
                     case 'save': PopupPopupForm1FormAPostSiseForm.btn_act_save(); break;
                     case 'new': PopupPopupForm1FormAPostSiseForm.btn_act_new(); break;
@@ -92,25 +91,6 @@
         (function( PopupPopupForm1FormAPostSiseForm, $, undefined ) {
             PopupPopupForm1FormAPostSiseForm.formA = {!! json_encode($formA) !!};
             PopupPopupForm1FormAPostSiseForm.mediaModal
-            // PopupPopupForm1FormAPostSiseForm.state = [
-            //     { Area: '독일', Value: 'Berlin', Caption: '베를린' },
-            //     { Area: '영국', Value: 'London', Caption: '런던' },
-            //     { Area: '일본', Value: 'Kansai', Caption: '간사이' },
-            //     { Area: '일본', Value: 'Dokyo', Caption: '도쿄' },
-            //     { Area: '중국', Value: 'Beijing', Caption: '베이징' },
-            //     { Area: '중국', Value: 'Shanghai', Caption: '상하이' },
-            //     { Area: '캐나다', Value: 'Toronto', Caption: '토론토' },
-            //     { Area: '호주', Value: 'Sydney', Caption: '시드니' },
-            //     { Area: '프랑스', Value: 'Paris', Caption: '파리' },
-            //     { Area: '미국', Value: 'Massachusetts', Caption: '매사추세츠 주' },
-            //     { Area: '미국', Value: 'Newyork', Caption: '뉴욕' },
-            // ];
-
-            // PopupPopupForm1FormAPostSiseForm.changeArea = function () {
-            //     const area = $('#sise-form').find('#area-select').val()
-            //     const filterState = PopupPopupForm1FormAPostSiseForm.state.filter(state => state['Area'] === area)
-            //     $('#sise-form').find('#state-select').html(create_options(filterState))
-            // }
 
             PopupPopupForm1FormAPostSiseForm.delete_media_id = function (media_dom_id) {
                 $('#sise-form').find(media_dom_id).val('')
@@ -136,8 +116,6 @@
             PopupPopupForm1FormAPostSiseForm.btn_act_new_callback = function () {
                 PopupPopupForm1FormAPostSiseForm.btn_act_new()
                 $('#sisetype-check-0').prop('checked', true)
-                // $('#sise-form').find('#province-check').trigger('change')
-                // PopupPopupForm1FormAPostSiseForm.changeArea()
             }
 
             PopupPopupForm1FormAPostSiseForm.show_popup_callback = async function (id) {
@@ -156,37 +134,15 @@
                     Pc2: $(sise_form).find('#area-select').val(),
                     Pc3: $(sise_form).find('#today-price-txt').val(),
                     Pc4: $(sise_form).find('#yesterday-price-txt').val(),
-                    // Pc2: $(sise_form).find('#yesterday-price-txt').val(),
-                    // Pc4: $(sise_form).find('#image-txt').val(),
-                    // Pc5: $(sise_form).find('#logo-txt').val(),
-                    // Pc6: $(sise_form).find('#state-select').val(),
-                    // Pc7: $(sise_form).find('#location-txt').val(),
-                    // Pc8: $(sise_form).find('#kind-txt').val(),
-                    // Pc9: $(sise_form).find('#link-txt').val(),
-                    // Pc10: $(sise_form).find('#lanking-txt').val(),
-
-                    // Pt1: $(sise_form).find('#introduce-textarea').val(),
-
-                    // Pd1: $(sise_form).find('#expenses-txt').val(),
-                    // Pd2: $(sise_form).find('#semester-txt').val(),
-                    // Pd3: $(sise_form).find('#top-txt').val(),
-                    // Pd4: $(sise_form).find('#left-txt').val(),
-                    // Pd5: $(sise_form).find('#popular-txt').val(),
-                    // Pd6: $(sise_form).find('#recommend-txt').val(),
-                    // Pd7: $(sise_form).find('#membership-name-txt').val().replace(/\s+/g, '_'),
-                    // Pd8: $(sise_form).find('#province-check:checked').val() ?? '0',
                 }
                 if (id < 0) {
                     parameter = { Id: id }
                 }
-                console.log(parameter)
 
                 return parameter;
             }
 
             PopupPopupForm1FormAPostSiseForm.fetch_sise = async function (id) {
-                console.log('fetch_sise')
-                console.log('api : ',PopupPopupForm1FormAPostSiseForm.formA['General']['PickApi'])
 
                 const response = await get_api_data(PopupPopupForm1FormAPostSiseForm.formA['General']['PickApi'], {
                     Page: [ { Id: id } ]
@@ -204,36 +160,13 @@
 
                 const sise = response.data.Page[0];
                 const sise_form = $('#sise-form')
-                // console.log(sise)
-                console.log('sise', sise)
+
                 $(sise_form).find('#Id').val(sise.Id)
                 $(sise_form).find('#membership-name-txt').val(sise.PostTitle)
                 $(sise_form).find(`input[name='sisetype'][value='${sise.Pc1}']`).prop('checked', true)
                 $(sise_form).find('#area-select').val(sise.Pc2)
                 $(sise_form).find('#today-price-txt').val(sise.Pc3)
                 $(sise_form).find('#yesterday-price-txt').val(sise.Pc4)
-                // $(sise_form).find('#province-check').prop('checked', sise.Pd8 == '1')
-                // $(sise_form).find('#province-check').trigger('change')
-
-                // PopupPopupForm1FormAPostSiseForm.changeArea()
-                // $(sise_form).find('#name-kor-txt').val(sise.Pc3)
-                // $(sise_form).find('#image-txt').val(sise.Pc4)
-                // $(sise_form).find('#logo-txt').val(sise.Pc5)
-                // $(sise_form).find('#state-select').val(sise.Pc6)
-                // $(sise_form).find('#location-txt').val(sise.Pc7)
-                // $(sise_form).find('#kind-txt').val(sise.Pc8)
-                // $(sise_form).find('#link-txt').val(sise.Pc9)
-                // $(sise_form).find('#lanking-txt').val(sise.Pc10)
-
-                // $(sise_form).find('#introduce-textarea').val(sise.Pt1)
-
-                // $(sise_form).find('#expenses-txt').val(sise.Pd1)
-                // $(sise_form).find('#semester-txt').val(sise.Pd2)
-                // $(sise_form).find('#top-txt').val(sise.Pd3)
-                // $(sise_form).find('#left-txt').val(sise.Pd4)
-                // $(sise_form).find('#popular-txt').val(sise.Pd5)
-                // $(sise_form).find('#recommend-txt').val(sise.Pd6)
-
             }
 
         }( window.PopupPopupForm1FormAPostSiseForm = window.PopupPopupForm1FormAPostSiseForm || {}, jQuery ));

+ 12 - 9
qry/erp/list/list-type1/post/post-sise-input/plain.sql

@@ -1,14 +1,17 @@
 select
-	mx.id as id,
-	post_title as c1,
-	mx.pc1 as c2,
-	mx.pc2 as c6,
-	mx.pc3 as c3,
-	mx.pc4 as c4,
+    mx.id as id,
+    post_title as c1,
+    mx.pc1 as c2,
+    CASE
+        WHEN mx.pc2 = 100 THEN '수도권/충청권'
+        WHEN mx.pc2 = 200 THEN '영남/제주권'
+        WHEN mx.pc2 = 300 THEN '호남권'
+    END as c6,
+    mx.pc3 as c3,
+    mx.pc4 as c4,
     ABS(mx.pc3 - mx.pc4) AS c5
 from
-	pro_post as mx
-	inner join pro_post_type as pt on pt.id = mx.post_type_id
+    pro_post as mx
+    inner join pro_post_type as pt on pt.id = mx.post_type_id
 -- @where
 and pt.post_code = 'sise'
--- @order