瀏覽代碼

fix: 统一空列表时返回空 DataFrame 而非 None

Sherlock 2 天之前
父節點
當前提交
b273bcc9e1
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      database/dao/mysql_dao.py

+ 4 - 4
database/dao/mysql_dao.py

@@ -105,7 +105,7 @@ class MySqlDao:
     def get_cust_by_ids(self, city_uuid, cust_id_list):
         """根据零售户列表查询其信息"""
         if not cust_id_list:
-            return None
+            return pd.DataFrame()
 
         query = text(f"""
         SELECT *
@@ -121,7 +121,7 @@ class MySqlDao:
     def get_shop_by_ids(self, city_uuid, cust_id_list):
         """根据零售户列表查询其信息"""
         if not cust_id_list:
-            return None
+            return pd.DataFrame()
 
         query = text(f"""
         SELECT *
@@ -137,7 +137,7 @@ class MySqlDao:
     def get_product_by_ids(self, city_uuid, product_id_list):
         """根据product_code列表查询其信息"""
         if not product_id_list:
-            return None
+            return pd.DataFrame()
 
         query = text(f"""
         SELECT *
@@ -153,7 +153,7 @@ class MySqlDao:
     def get_order_by_product_ids(self, city_uuid, product_ids):
         """获取指定香烟列表的所有售卖记录"""
         if not product_ids:
-            return None
+            return pd.DataFrame()
 
         query = text(f"""
         SELECT *