瀏覽代碼

fix: 信息价类别总表初始化报错问题

vian 1 年之前
父節點
當前提交
de3c65eae4
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      modules/price_info_class/facade/index.js

+ 1 - 1
modules/price_info_class/facade/index.js

@@ -7,7 +7,7 @@ const priceInfoClassModel = mongoose.model('infoPriceClass');
 // 旧数据没有ID,初次加载需要给数据加上ID
 const setIDForData = async () => {
     const item = await priceInfoClassModel.findOne({}).lean();
-    if (item.ID) {
+    if (!item || item.ID) {
         return;
     }
     const bulks = [];