Explorar o código

单价文件唯一限制

zhangweicheng %!s(int64=7) %!d(string=hai) anos
pai
achega
c2e5b8d872
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      modules/all_models/unit_price.js

+ 1 - 1
modules/all_models/unit_price.js

@@ -11,7 +11,7 @@ let Schema = mongoose.Schema;
 let collectionName = 'unit_price';
 let modelSchema = {
     // 自增ID
-    id: Number,
+    id: {type:Number,unique: true},
     // 基价单价
     base_price: String,
     // 市场单价