Commit b5dae0b9 authored by 成旭东's avatar 成旭东

fix

parent 2141724c
Pipeline #28005 passed with stage
in 5 minutes 23 seconds
......@@ -105,7 +105,7 @@ module.exports = app => {
});
model.associate = function() {
app.wafangModel.WafangVideo.belongsTo(app.wafangModel.WafangProject, { as: 'project', sourceKey: 'project_id', foreignKey: 'id' });
app.wafangModel.WafangVideo.belongsTo(app.wafangModel.WafangProject, { as: 'project', foreignKey: 'project_id', targetKey: 'id' });
};
return model;
......
......@@ -84,13 +84,20 @@ export default class EstateVideoService extends Service {
if (!record) {
this.ctx.throw(400, '记录不存在');
}
await record.update(params);
await record.update({
...params,
updated_at: new Date(),
});
return record;
}
async create(params: any) {
const { ctx, modelGroupName, modelName } = this;
const record = await ctx[modelGroupName][modelName].create(params);
const record = await ctx[modelGroupName][modelName].create({
...params,
created_at: new Date(),
updated_at: new Date(),
});
return record;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment