diff --git a/src/model/config.model.js b/src/model/config.model.js index f600bef..9e70bb9 100644 --- a/src/model/config.model.js +++ b/src/model/config.model.js @@ -13,7 +13,7 @@ const Config = seq.define("chicken_config", { market_life_min: { type: DataTypes.INTEGER, allowNull: false, - defaultValue: 0, + defaultValue: 36, comment: "出栏日龄,限制最小的出栏日龄,单位天", }, }); diff --git a/src/service/config.service.js b/src/service/config.service.js index a72c455..f93ffdd 100644 --- a/src/service/config.service.js +++ b/src/service/config.service.js @@ -1,26 +1,15 @@ const Config = require("../model/config.model"); class ConfigService { - async initConfig(house_id, market_life_min = 0) { + async initConfig(house_id) { const configInfo = await Config.findOne({ where: { house_id, }, }); if (configInfo) { - await Config.update( - { - market_life_min, - }, - { - where: { - house_id, - }, - } - ); } else { await Config.create({ house_id, - market_life_min, }); } }