|
|
@ -675,17 +675,6 @@ User.init({ |
|
|
defaultValue: Sequelize.NOW, |
|
|
defaultValue: Sequelize.NOW, |
|
|
onUpdate: Sequelize.NOW |
|
|
onUpdate: Sequelize.NOW |
|
|
}, |
|
|
}, |
|
|
// 新增字段
|
|
|
|
|
|
sourceType: { |
|
|
|
|
|
type: DataTypes.STRING(50), |
|
|
|
|
|
allowNull: true, |
|
|
|
|
|
comment: '货源类型' |
|
|
|
|
|
}, |
|
|
|
|
|
supplyStatus: { |
|
|
|
|
|
type: DataTypes.STRING(50), |
|
|
|
|
|
allowNull: true, |
|
|
|
|
|
comment: '供应状态' |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
}, { |
|
|
}, { |
|
|
sequelize, |
|
|
sequelize, |
|
|
@ -782,6 +771,16 @@ Product.init({ |
|
|
type: DataTypes.DATE, |
|
|
type: DataTypes.DATE, |
|
|
defaultValue: Sequelize.NOW, |
|
|
defaultValue: Sequelize.NOW, |
|
|
onUpdate: Sequelize.NOW |
|
|
onUpdate: Sequelize.NOW |
|
|
|
|
|
}, |
|
|
|
|
|
sourceType: { |
|
|
|
|
|
type: DataTypes.STRING(50), |
|
|
|
|
|
allowNull: true, |
|
|
|
|
|
comment: '货源类型' |
|
|
|
|
|
}, |
|
|
|
|
|
supplyStatus: { |
|
|
|
|
|
type: DataTypes.STRING(50), |
|
|
|
|
|
allowNull: true, |
|
|
|
|
|
comment: '供应状态' |
|
|
} |
|
|
} |
|
|
}, { |
|
|
}, { |
|
|
sequelize, |
|
|
sequelize, |
|
|
@ -3458,7 +3457,7 @@ app.post('/api/favorites/list', async (req, res) => { |
|
|
{ |
|
|
{ |
|
|
model: Product, |
|
|
model: Product, |
|
|
as: 'Product', // 与关联定义中的别名一致
|
|
|
as: 'Product', // 与关联定义中的别名一致
|
|
|
attributes: ['productId', 'productName', 'price', 'quantity', 'grossWeight', 'imageUrls', 'created_at', 'specification', 'yolk'] |
|
|
attributes: ['productId', 'productName', 'price', 'quantity', 'grossWeight', 'imageUrls', 'created_at', 'specification', 'yolk', 'sourceType', 'supplyStatus'] |
|
|
} |
|
|
} |
|
|
], |
|
|
], |
|
|
order: [['date', 'DESC']] |
|
|
order: [['date', 'DESC']] |
|
|
|