|
|
|
@ -1766,6 +1766,13 @@ Product.init({ |
|
|
|
allowNull: true, |
|
|
|
comment: '规格状态', |
|
|
|
defaultValue: '0' |
|
|
|
}, |
|
|
|
// 讲价字段
|
|
|
|
bargaining: { |
|
|
|
type: DataTypes.INTEGER, |
|
|
|
defaultValue: 0, |
|
|
|
allowNull: false, |
|
|
|
comment: '是否允许讲价,0允许,1不允许' |
|
|
|
} |
|
|
|
}, { |
|
|
|
sequelize, |
|
|
|
@ -5511,7 +5518,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', 'freshness', 'costprice','description', 'frequency', 'product_log', 'spec_status', 'status', 'label'], |
|
|
|
attributes: ['productId', 'productName', 'price', 'quantity', 'grossWeight', 'imageUrls', 'created_at', 'specification', 'yolk', 'sourceType', 'supplyStatus', 'producting', 'product_contact', 'contact_phone', 'region', 'freshness', 'costprice','description', 'frequency', 'product_log', 'spec_status', 'status', 'label', 'bargaining'], |
|
|
|
where: { |
|
|
|
productId, |
|
|
|
status: { [Sequelize.Op.not]: 'hidden' } |
|
|
|
|