|
|
@@ -65,12 +65,6 @@ class Deli extends ResourceController
|
|
|
|
|
|
$lists = $builder->get()->getResultArray();
|
|
|
|
|
|
- // 디버깅 로그 추가
|
|
|
- error_log("itemlist (배송관리) - memberType: " . ($memberType ?? 'null') . ", companyNumber: " . ($companyNumber ?? 'null') . ", infSeq: " . ($infSeq ?? 'null'));
|
|
|
- error_log("itemlist (배송관리) - result count: " . count($lists));
|
|
|
- if (count($lists) > 0) {
|
|
|
- error_log("itemlist (배송관리) - sample data: " . json_encode($lists[0]));
|
|
|
- }
|
|
|
|
|
|
return $this->respond($lists, 200);
|
|
|
}
|
|
|
@@ -103,12 +97,6 @@ class Deli extends ResourceController
|
|
|
$builder->orderBy('I.ORDER_DATE', 'DESC');
|
|
|
$lists = $builder->get()->getResultArray();
|
|
|
|
|
|
- // 디버깅 로그 추가
|
|
|
- error_log("delilist (송장등록용) - itemSeq: " . ($itemSeq ?? 'null') . ", infSeq: " . ($infSeq ?? 'null'));
|
|
|
- error_log("delilist (송장등록용) - result count: " . count($lists));
|
|
|
- if (count($lists) > 0) {
|
|
|
- error_log("delilist (송장등록용) - sample data: " . json_encode($lists[0]));
|
|
|
- }
|
|
|
|
|
|
return $this->respond($lists, 200);
|
|
|
}
|
|
|
@@ -315,12 +303,6 @@ class Deli extends ResourceController
|
|
|
$builder->orderBy('IOL.REG_DATE', 'DESC');
|
|
|
$lists = $builder->get()->getResultArray();
|
|
|
|
|
|
- // 디버깅 로그 추가
|
|
|
- error_log("getShippingList - memberType: " . ($memberType ?? 'null') . ", companyNumber: " . ($companyNumber ?? 'null') . ", infSeq: " . ($infSeq ?? 'null'));
|
|
|
- error_log("getShippingList - result count: " . count($lists));
|
|
|
- if (count($lists) > 0) {
|
|
|
- error_log("getShippingList - sample data: " . json_encode($lists[0]));
|
|
|
- }
|
|
|
|
|
|
return $this->respond($lists, 200);
|
|
|
}
|
|
|
@@ -372,12 +354,6 @@ class Deli extends ResourceController
|
|
|
|
|
|
$lists = $builder->get()->getResultArray();
|
|
|
|
|
|
- // 디버깅 로그 추가
|
|
|
- error_log("getDeliveredList - memberType: " . ($memberType ?? 'null') . ", companyNumber: " . ($companyNumber ?? 'null') . ", infSeq: " . ($infSeq ?? 'null'));
|
|
|
- error_log("getDeliveredList - result count: " . count($lists));
|
|
|
- if (count($lists) > 0) {
|
|
|
- error_log("getDeliveredList - sample data: " . json_encode($lists[0]));
|
|
|
- }
|
|
|
|
|
|
return $this->respond($lists, 200);
|
|
|
}
|
|
|
@@ -493,90 +469,4 @@ class Deli extends ResourceController
|
|
|
return $this->respond($lists, 200);
|
|
|
}
|
|
|
|
|
|
- // 대기중인 개별 주문 조회
|
|
|
- public function getPendingOrderList()
|
|
|
- {
|
|
|
- $db = \Config\Database::connect();
|
|
|
-
|
|
|
- // POST JSON 파라미터 받기
|
|
|
- $request = $this->request->getJSON(true);
|
|
|
-
|
|
|
- $memberType = isset($request['MEMBER_TYPE']) ? $request['MEMBER_TYPE'] : null;
|
|
|
- $companyNumber = isset($request['COMPANY_NUMBER']) ? $request['COMPANY_NUMBER'] : null;
|
|
|
- $infSeq = isset($request['INF_SEQ']) ? $request['INF_SEQ'] : null;
|
|
|
-
|
|
|
- // 디버깅 로그
|
|
|
- log_message('info', 'getPendingOrderList 호출됨');
|
|
|
- log_message('info', 'Request 파라미터: ' . json_encode($request));
|
|
|
- log_message('info', 'MEMBER_TYPE: ' . $memberType);
|
|
|
- log_message('info', 'COMPANY_NUMBER: ' . $companyNumber);
|
|
|
-
|
|
|
- // 먼저 ITEM_LIST에서 COMPANY_NUMBER 확인해보자
|
|
|
- $itemResult = $db->table('ITEM_LIST')->where('SEQ', 1)->get()->getRowArray();
|
|
|
- log_message('info', 'ITEM_SEQ=1인 제품 정보: ' . json_encode($itemResult));
|
|
|
-
|
|
|
- $builder = $db->table('ITEM_ORDER_LIST IOL')
|
|
|
- ->select('IOL.*, IL.ITEM_NAME, IL.COMPANY_NUMBER, IM.NICK_NAME')
|
|
|
- ->join('ITEM_LIST IL', 'IOL.ITEM_SEQ = IL.SEQ', 'left')
|
|
|
- ->join('INF_MEMBER IM', 'IOL.INF_SEQ = IM.SEQ', 'left')
|
|
|
- ->where('IOL.DEL_YN', 'N');
|
|
|
-
|
|
|
- // 배송정보가 등록되지 않은 주문만 (대기중)
|
|
|
- $builder->where('(IOL.DELI_COMP IS NULL OR IOL.DELI_COMP = "")')
|
|
|
- ->where('(IOL.DELI_NUMB IS NULL OR IOL.DELI_NUMB = "")');
|
|
|
-
|
|
|
- // 벤더: 자사 제품의 주문만
|
|
|
- if ($memberType === 'VENDOR') {
|
|
|
- if (empty($companyNumber)) {
|
|
|
- log_message('error', 'VENDOR 타입인데 COMPANY_NUMBER가 없음');
|
|
|
- return $this->respond([], 200);
|
|
|
- }
|
|
|
- $builder->where('IL.COMPANY_NUMBER', $companyNumber);
|
|
|
- log_message('info', 'VENDOR 필터 적용: COMPANY_NUMBER = ' . $companyNumber);
|
|
|
-
|
|
|
- // 임시로 JOIN 조건 확인을 위해 COMPANY_NUMBER 조건을 제거하고 테스트
|
|
|
- log_message('info', '=== 임시 테스트: COMPANY_NUMBER 조건 제거 후 조회 ===');
|
|
|
- $testBuilder = $db->table('ITEM_ORDER_LIST IOL')
|
|
|
- ->select('IOL.*, IL.ITEM_NAME, IL.COMPANY_NUMBER, IM.NICK_NAME')
|
|
|
- ->join('ITEM_LIST IL', 'IOL.ITEM_SEQ = IL.SEQ', 'left')
|
|
|
- ->join('INF_MEMBER IM', 'IOL.INF_SEQ = IM.SEQ', 'left')
|
|
|
- ->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 = "")');
|
|
|
-
|
|
|
- $testQuery = $testBuilder->getCompiledSelect(false);
|
|
|
- log_message('info', '테스트 SQL 쿼리: ' . $testQuery);
|
|
|
-
|
|
|
- $testResult = $testBuilder->get()->getResultArray();
|
|
|
- log_message('info', '테스트 조회 결과 개수: ' . count($testResult));
|
|
|
- if (count($testResult) > 0) {
|
|
|
- log_message('info', '테스트 첫 번째 데이터: ' . json_encode($testResult[0]));
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 인플루언서: 본인 주문만
|
|
|
- if ($memberType === 'INFLUENCER') {
|
|
|
- if (empty($infSeq)) {
|
|
|
- log_message('error', 'INFLUENCER 타입인데 INF_SEQ가 없음');
|
|
|
- return $this->respond([], 200);
|
|
|
- }
|
|
|
- $builder->where('IOL.INF_SEQ', $infSeq);
|
|
|
- log_message('info', 'INFLUENCER 필터 적용: INF_SEQ = ' . $infSeq);
|
|
|
- }
|
|
|
-
|
|
|
- $builder->orderBy('IOL.REG_DATE', 'DESC');
|
|
|
-
|
|
|
- // 쿼리 확인
|
|
|
- $compiledQuery = $builder->getCompiledSelect(false);
|
|
|
- log_message('info', 'SQL 쿼리: ' . $compiledQuery);
|
|
|
-
|
|
|
- $lists = $builder->get()->getResultArray();
|
|
|
-
|
|
|
- log_message('info', '조회된 데이터 개수: ' . count($lists));
|
|
|
- if (count($lists) > 0) {
|
|
|
- log_message('info', '첫 번째 데이터: ' . json_encode($lists[0]));
|
|
|
- }
|
|
|
-
|
|
|
- return $this->respond($lists, 200);
|
|
|
- }
|
|
|
}
|