|
|
|
@ -3866,7 +3866,7 @@ app.post('/api/products/detail', async (req, res) => { |
|
|
|
|
|
|
|
// 查询商品详情 - 排除hidden状态商品,直接使用Product表中的reservedCount字段
|
|
|
|
const product = await Product.findOne({ |
|
|
|
attributes: ['productId', 'productName', 'price', 'quantity', 'grossWeight', 'imageUrls', 'created_at', 'specification', 'yolk', 'sourceType', 'supplyStatus', 'producting', 'product_contact', 'contact_phone', 'region'], |
|
|
|
attributes: ['productId', 'productName', 'price', 'quantity', 'grossWeight', 'imageUrls', 'created_at', 'specification', 'yolk', 'sourceType', 'supplyStatus', 'producting', 'product_contact', 'contact_phone', 'region', 'freshness', 'costprice','description'], |
|
|
|
where: { |
|
|
|
productId, |
|
|
|
status: { [Sequelize.Op.not]: 'hidden' } |
|
|
|
@ -3944,6 +3944,7 @@ app.post('/api/products/detail', async (req, res) => { |
|
|
|
console.log('商品详情 - 最终返回的毛重值:', updatedProduct.grossWeight, '类型:', typeof updatedProduct.grossWeight); |
|
|
|
console.log('商品详情 - 返回的收藏人数:', updatedProduct.reservedCount, '类型:', typeof updatedProduct.reservedCount); |
|
|
|
console.log('商品详情 - producting字段:', updatedProduct.producting, '类型:', typeof updatedProduct.producting); |
|
|
|
console.log('商品详情 - description字段:', updatedProduct.description, '类型:', typeof updatedProduct.description); |
|
|
|
|
|
|
|
res.json({ |
|
|
|
success: true, |
|
|
|
|