|
|
@@ -76,7 +76,8 @@ module.exports = app => {
|
|
|
for (const nu of needUpdateArray) {
|
|
|
if (data[nu] !== undefined && mesInfo[nu] !== data[nu]) updateData[nu] = data[nu];
|
|
|
}
|
|
|
- await transaction.update(this.tableName, updateData);
|
|
|
+ // 如果只有id,则不更新
|
|
|
+ if (Object.keys(updateData).length > 1) await transaction.update(this.tableName, updateData);
|
|
|
if (updateData.m_price !== undefined || updateData.weight_num !== undefined || needCalc) {
|
|
|
const mnInfo = mn_id ? await transaction.get(this.ctx.service.materialExponentNode.tableName, { mid: this.ctx.material.id, id: mn_id }) : null;
|
|
|
const msInfo = ms_id && !mn_id ? await transaction.get(this.ctx.service.materialStage.tableName, { mid: this.ctx.material.id, id: ms_id }) : null;
|