Parcourir la source

+ DELIVERY_STATUS 참조하여 PNDDING인것만 체크

송용우 il y a 4 mois
Parent
commit
fd33d24233
2 fichiers modifiés avec 20 ajouts et 7 suppressions
  1. 14 4
      backend/app/Controllers/Deli.php
  2. 6 3
      pages/view/vendor/dashboard/index.vue

+ 14 - 4
backend/app/Controllers/Deli.php

@@ -492,10 +492,20 @@ class Deli extends ResourceController
             ->join('ITEM_LIST IL', 'IOL.ITEM_SEQ = IL.SEQ', 'inner')
             ->join('INF_MEMBER IM', 'IOL.INF_SEQ = IM.SEQ', 'left')
             ->where('IL.COMPANY_NUMBER', $companyNumber)
-            ->where('IOL.DEL_YN', 'N')
-            ->where('(IOL.DELI_COMP IS NULL OR IOL.DELI_COMP = "")')
-            ->where('(IOL.DELI_NUMB IS NULL OR IOL.DELI_NUMB = "")')
-            ->orderBy('IOL.REG_DATE', 'DESC');
+            ->where('IOL.DEL_YN', 'N');
+            
+        // DELIVERY_STATUS 컬럼이 존재하는지 확인하고 조건 추가
+        $columns = $db->getFieldNames('ITEM_ORDER_LIST');
+        if (in_array('DELIVERY_STATUS', $columns)) {
+            // DELIVERY_STATUS가 PENDING이거나 NULL인 경우 (대기중)
+            $builder->where('(IOL.DELIVERY_STATUS = "PENDING" OR IOL.DELIVERY_STATUS IS NULL)');
+        } else {
+            // DELIVERY_STATUS 컬럼이 없으면 기존 방식으로 배송정보로 판단
+            $builder->where('(IOL.DELI_COMP IS NULL OR IOL.DELI_COMP = "")')
+                    ->where('(IOL.DELI_NUMB IS NULL OR IOL.DELI_NUMB = "")');
+        }
+        
+        $builder->orderBy('IOL.REG_DATE', 'DESC');
             
         $lists = $builder->get()->getResultArray();
         

+ 6 - 3
pages/view/vendor/dashboard/index.vue

@@ -1020,17 +1020,18 @@
       const userInfo =
         useAuthStore().getSnsTempData?.user ||
         JSON.parse(localStorage.getItem("authStore") || "{}")?.auth;
-      
+
+      console.error(userInfo, "userInfo");
       const requestData = {
         MEMBER_TYPE: "VENDOR",
         COMPANY_NUMBER: userInfo?.COMPANY_NUMBER,
       };
 
       console.log("대기중 주문 API 요청:", requestData);
-      
+
       const response = await useAxios().post("/deli/pendingOrdersForVendor", requestData);
       const pendingData = response.data || [];
-      
+
       console.log("대기중 주문 API 응답:", pendingData);
       console.log("대기중 주문 데이터 개수:", pendingData.length);
 
@@ -1083,6 +1084,8 @@
         COMPANY_NUMBER: userInfo?.COMPANY_NUMBER,
       };
 
+      console.log(_req, "배송중 데이터");
+
       const response = await useAxios().post("/deli/shipping", _req);
       const shippingData = response.data || [];