|
|
@ -1937,7 +1937,8 @@ app.post('/api/product/list', async (req, res) => { |
|
|
'region', // 【新增】确保返回地区字段
|
|
|
'region', // 【新增】确保返回地区字段
|
|
|
'sourceType', // 【新增】确保返回货源类型字段
|
|
|
'sourceType', // 【新增】确保返回货源类型字段
|
|
|
'supplyStatus', // 【新增】确保返回供应状态字段
|
|
|
'supplyStatus', // 【新增】确保返回供应状态字段
|
|
|
'category' // 【新增】确保返回商品种类字段
|
|
|
'category', // 【新增】确保返回商品种类字段
|
|
|
|
|
|
'producting' // 【新增】确保返回产品包装字段
|
|
|
] |
|
|
] |
|
|
}, |
|
|
}, |
|
|
order: [['created_at', 'DESC']], |
|
|
order: [['created_at', 'DESC']], |
|
|
@ -3771,7 +3772,7 @@ app.post('/api/products/detail', async (req, res) => { |
|
|
|
|
|
|
|
|
// 查询商品详情 - 排除hidden状态商品,直接使用Product表中的reservedCount字段
|
|
|
// 查询商品详情 - 排除hidden状态商品,直接使用Product表中的reservedCount字段
|
|
|
const product = await Product.findOne({ |
|
|
const product = await Product.findOne({ |
|
|
attributes: ['productId', 'productName', 'price', 'quantity', 'grossWeight', 'imageUrls', 'created_at', 'specification', 'yolk', 'sourceType', 'supplyStatus'], |
|
|
attributes: ['productId', 'productName', 'price', 'quantity', 'grossWeight', 'imageUrls', 'created_at', 'specification', 'yolk', 'sourceType', 'supplyStatus', 'producting'], |
|
|
where: { |
|
|
where: { |
|
|
productId, |
|
|
productId, |
|
|
status: { [Sequelize.Op.not]: 'hidden' } |
|
|
status: { [Sequelize.Op.not]: 'hidden' } |
|
|
@ -3848,6 +3849,7 @@ app.post('/api/products/detail', async (req, res) => { |
|
|
|
|
|
|
|
|
console.log('商品详情 - 最终返回的毛重值:', updatedProduct.grossWeight, '类型:', typeof updatedProduct.grossWeight); |
|
|
console.log('商品详情 - 最终返回的毛重值:', updatedProduct.grossWeight, '类型:', typeof updatedProduct.grossWeight); |
|
|
console.log('商品详情 - 返回的收藏人数:', updatedProduct.reservedCount, '类型:', typeof updatedProduct.reservedCount); |
|
|
console.log('商品详情 - 返回的收藏人数:', updatedProduct.reservedCount, '类型:', typeof updatedProduct.reservedCount); |
|
|
|
|
|
console.log('商品详情 - producting字段:', updatedProduct.producting, '类型:', typeof updatedProduct.producting); |
|
|
|
|
|
|
|
|
res.json({ |
|
|
res.json({ |
|
|
success: true, |
|
|
success: true, |
|
|
|