Spaces:
Sleeping
Sleeping
Update db_connector.py
Browse files- db_connector.py +1 -3
db_connector.py
CHANGED
|
@@ -61,14 +61,12 @@ async def fetch_found_items(limit=100, offset=0):
|
|
| 61 |
try:
|
| 62 |
with get_db_connection() as connection:
|
| 63 |
with connection.cursor() as cursor:
|
| 64 |
-
# 습득물 데이터 조회 쿼리 (ERD에 맞게 수정)
|
| 65 |
-
# name 컬럼을 title로 매핑, detail 컬럼을 content로 매핑
|
| 66 |
query = """
|
| 67 |
SELECT f.id, f.user_id, f.item_category_id, f.name as title, f.color,
|
| 68 |
f.detail as content, f.location, f.image, f.status, f.found_at as lost_at,
|
| 69 |
f.created_at, f.management_id, f.stored_at,
|
| 70 |
ic.name as category_name,
|
| 71 |
-
ic.
|
| 72 |
ic.name as minorCategory
|
| 73 |
FROM found_item f
|
| 74 |
LEFT JOIN item_category ic ON f.item_category_id = ic.id
|
|
|
|
| 61 |
try:
|
| 62 |
with get_db_connection() as connection:
|
| 63 |
with connection.cursor() as cursor:
|
|
|
|
|
|
|
| 64 |
query = """
|
| 65 |
SELECT f.id, f.user_id, f.item_category_id, f.name as title, f.color,
|
| 66 |
f.detail as content, f.location, f.image, f.status, f.found_at as lost_at,
|
| 67 |
f.created_at, f.management_id, f.stored_at,
|
| 68 |
ic.name as category_name,
|
| 69 |
+
ic.level as majorCategory, # major_category 대신 level 사용
|
| 70 |
ic.name as minorCategory
|
| 71 |
FROM found_item f
|
| 72 |
LEFT JOIN item_category ic ON f.item_category_id = ic.id
|