Selaa lähdekoodia

주문 내역 관련 테이블명 변경에 따라 나머지 페이지도 적용

interscope_003\interscope 3 kuukautta sitten
vanhempi
commit
57060df5fe

+ 5 - 2
assets/scss/mode-w-m.scss

@@ -8189,7 +8189,7 @@ z
 }
 
 .item-info{
-  width: 100%;
+  width: calc(100% - 50px);
 }
 
 .item-info h4 {
@@ -8430,8 +8430,11 @@ z
   }
 
   .influencer-name {
-    color: #666;
+    background-color: #1976d2;
+    border-radius: 12px;
+    color: #fff;
     font-size: 0.8rem;
+    padding: 4px 8px;
   }
 
   .order-date {

+ 12 - 92
backend/app/Controllers/Dashboard.php

@@ -22,13 +22,13 @@ class Dashboard extends ResourceController
         try {
             $limit = isset($request['LIMIT']) ? $request['LIMIT'] : null;
 
-            $builder = $db->table('ITEM_ORDER_LIST D')
+            $builder = $db->table('ORDER_LIST D')
                 ->select('D.*, I.NAME as ITEM_NAME, I.COMPANY_NUMBER, I.CONTACT_INF, U.NICK_NAME as INF_NICK_NAME, U.NAME as INF_NAME')
                 ->join('ITEM_LIST I', 'D.ITEM_SEQ = I.SEQ', 'left')
                 ->join('USER_LIST U', 'I.CONTACT_INF = U.SEQ', 'left')
-                ->where('D.DELI_COMP', '') // 배송 정보가 등록되지 않은 정보만 신규 주문으로 판단
+                //->where('D.DELI_COMP', '') // 배송 정보가 등록되지 않은 정보만 신규 주문으로 판단
                 ->where('I.DEL_YN', 'N')
-                ->orderBy('D.REG_DATE', 'DESC');
+                ->orderBy('D.CONTENT_REGDATE', 'DESC');
 
             // 사용자 타입별 필터링
             if ($memberType === 'VENDOR' && !empty($companyNumber)) {
@@ -143,7 +143,7 @@ class Dashboard extends ResourceController
         $limit = isset($request['LIMIT']) ? $request['LIMIT'] : 10;
 
         try {
-            $builder = $db->table('ITEM_ORDER_LIST D')
+            $builder = $db->table('ORDER_LIST D')
                 ->select('I.CONTACT_INF as INF_SEQ, INF.NICK_NAME as INF_NAME, INF.NAME as INF_REAL_NAME, INF.PHONE, COUNT(D.SEQ) as ORDER_COUNT')
                 ->join('ITEM_LIST I', 'D.ITEM_SEQ = I.SEQ', 'inner')
                 ->join('USER_LIST INF', 'I.CONTACT_INF = INF.SEQ', 'left')
@@ -189,25 +189,25 @@ class Dashboard extends ResourceController
 
         $db = \Config\Database::connect();
         $request = $this->request->getJSON(true);
-        
+
         $contactInf = isset($request['CONTACT_INF']) ? $request['CONTACT_INF'] : null;
         $companyNumber = isset($request['COMPANY_NUMBER']) ? $request['COMPANY_NUMBER'] : null;
-        
+
         try {
             $builder = $db->table('ITEM_LIST I')
-                ->select('I.*, COALESCE(SUM(D.QTY), 0) as QTY, COALESCE(COUNT(D.SEQ), 0) as ORDER_COUNT')
-                ->join('ITEM_ORDER_LIST D', 'I.SEQ = D.ITEM_SEQ', 'left')
+                ->select('I.*, COALESCE(COUNT(D.SEQ), 0) as ORDER_COUNT')
+                ->join('ORDER_LIST D', 'I.SEQ = D.ITEM_SEQ', 'left')
                 ->where('I.DEL_YN', 'N')
                 ->groupBy('I.SEQ')
                 ->orderBy('I.ORDER_END_DATE', 'DESC');
-                
+
             if (!empty($contactInf) && !empty($companyNumber)) {
                 $builder->where('I.CONTACT_INF', $contactInf)
-                       ->where('I.COMPANY_NUMBER', $companyNumber);
+                    ->where('I.COMPANY_NUMBER', $companyNumber);
             }
-            
+
             $items = $builder->get()->getResultArray();
-            
+
             return $this->respond([
                 'data' => $items,
                 'total' => count($items)
@@ -219,84 +219,4 @@ class Dashboard extends ResourceController
             ], 500);
         }
     }
-
-
-    // 대시보드 전체 통계 요약
-    public function summary()
-    {
-        // 한국 시간으로 설정
-        date_default_timezone_set('Asia/Seoul');
-
-        $db = \Config\Database::connect();
-        $request = $this->request->getJSON(true);
-
-        $companyNumber = isset($request['COMPANY_NUMBER']) ? $request['COMPANY_NUMBER'] : null;
-        $memberType = isset($request['MEMBER_TYPE']) ? $request['MEMBER_TYPE'] : null;
-        $memberSeq = isset($request['MEMBER_SEQ']) ? $request['MEMBER_SEQ'] : null;
-
-        try {
-            $today = date('Y-m-d');
-            $weekAgo = date('Y-m-d', strtotime('-7 days'));
-
-            // 기본 조건 설정
-            $whereConditions = ['I.DEL_YN' => 'N'];
-
-            if ($memberType === 'VENDOR' && !empty($companyNumber)) {
-                $whereConditions['I.COMPANY_NUMBER'] = $companyNumber;
-            } elseif ($memberType === 'BRAND' && !empty($memberSeq)) {
-                $whereConditions['I.CONTACT_BRD'] = $memberSeq;
-            } elseif ($memberType === 'INFLUENCER' && !empty($memberSeq)) {
-                $whereConditions['I.CONTACT_INF'] = $memberSeq;
-            }
-
-            // 최근 7일 주문 수
-            $recentOrdersCount = $db->table('ITEM_ORDER_LIST D')
-                ->join('ITEM_LIST I', 'D.ITEM_SEQ = I.SEQ', 'inner')
-                ->where('I.DEL_YN', 'N')
-                ->where('D.REGDATE >=', $weekAgo . ' 00:00:00')
-                ->where($whereConditions)
-                ->countAllResults();
-
-            // 진행중인 공동구매 수
-            $activeItemsCount = $db->table('ITEM_LIST I')
-                ->where('I.STATUS', 0)
-                ->where('I.SHOW_YN', 'Y')
-                ->where('I.TYPE', 'GROUP_BUY')
-                ->where('I.ORDER_END_DATE >=', $today)
-                ->where($whereConditions)
-                ->countAllResults();
-
-            // 총 주문 건수
-            $totalSalesCount = $db->table('ITEM_ORDER_LIST D')
-                ->join('ITEM_LIST I', 'D.ITEM_SEQ = I.SEQ', 'inner')
-                ->where('I.DEL_YN', 'N')
-                ->where($whereConditions)
-                ->countAllResults();
-
-            // 활성 인플루언서 수 (주문이 있는 인플루언서)
-            $activeInfluencersCount = $db->table('ITEM_ORDER_LIST D')
-                ->select('I.CONTACT_INF')
-                ->join('ITEM_LIST I', 'D.ITEM_SEQ = I.SEQ', 'inner')
-                ->where('I.DEL_YN', 'N')
-                ->where('I.CONTACT_INF >', 0)
-                ->where($whereConditions)
-                ->distinct()
-                ->countAllResults();
-
-            $summary = [
-                'recent_orders_count' => $recentOrdersCount,
-                'active_items_count' => $activeItemsCount,
-                'total_sales_count' => $totalSalesCount,
-                'active_influencers_count' => $activeInfluencersCount
-            ];
-
-            return $this->respond($summary, 200);
-        } catch (\Exception $e) {
-            return $this->respond([
-                'status' => 'fail',
-                'message' => 'DB 오류: ' . $e->getMessage()
-            ], 500);
-        }
-    }
-
 }

+ 1 - 1
components/common/header.vue

@@ -20,7 +20,7 @@
       <div class="pro--info inf">{{ memberTypeText }}</div>
 
       <!-- 알림 센터 추가 -->
-      <NotificationCenter />
+      <!-- <NotificationCenter /> -->
     </div>
     <nav class="gnb">
       <ul class="depth1">

+ 0 - 9
pages/view/common/dashboard/detail.vue

@@ -50,7 +50,6 @@
                       :paginationPageSize="pageObj.pageSize"
                       :suppressPaginationPanel="true"
                       @grid-ready="onGridReady"
-                      @cell-value-changed="onCellValueChanged"
                     >
                     </ag-grid-vue>
                   </div>
@@ -140,14 +139,6 @@ const gridOptions = ref({
         return params.value ? Number(params.value).toLocaleString() : '0';
       }
     },
-    {
-      headerName: "총 수량",
-      field: "QTY",
-      width: 10,
-      valueFormatter: (params) => {
-        return params.value ? Number(params.value).toLocaleString() : '0';
-      }
-    },
     {
       headerName: "공동구매 기간",
       field: "ORDER_START_DATE",

+ 4 - 3
pages/view/common/dashboard/index.vue

@@ -81,8 +81,8 @@
                     <h4>{{ order.ITEM_NAME }}</h4>
                     <div class="order-meta">
                       <!-- <span class="order-number">#{{ order.ORDER_NUMB }}</span> -->
-                      <span class="influencer-name">{{ order.INF_NICK_NAME || order.INF_NAME }}</span>
-                      <div class="order-date">{{ formatDateTime(order.UPDATE_DATE) }}</div>
+                      <span class="influencer-name">#{{ order.INF_NICK_NAME || order.INF_NAME }}</span>
+                      <div class="order-date">{{ formatDateTime(order.CONTENT_REGDATE) }}</div>
                     </div>
                   </div>
                 </div>
@@ -346,11 +346,12 @@
   const formatDateTime = (dateStr) => {
     if (!dateStr) return '';
     const date = new Date(dateStr);
+    const year = date.getFullYear();
     const month = String(date.getMonth() + 1).padStart(2, '0');
     const day = String(date.getDate()).padStart(2, '0');
     const hours = String(date.getHours()).padStart(2, '0');
     const minutes = String(date.getMinutes()).padStart(2, '0');
-    return `${month}.${day} ${hours}:${minutes}`;
+    return `${year}.${month}.${day} ${hours}:${minutes}`;
   };
 
   const showComingSoon = () => {

+ 1 - 1
pages/view/common/item/detail.vue

@@ -918,7 +918,7 @@ const downloadExcel = () => {
   const productName = form.value.formValue1 ? 
     form.value.formValue1.replace(/[\\/:*?"<>|]/g, "_") : "제품";
   
-  const fileName = `${productName}_주문관리_${dateString}.xlsx`;
+  const fileName = `${productName}_주문 내역_${dateString}.xlsx`;
 
   // 엑셀 파일 다운로드
   XLSX.writeFile(workbook, fileName);