|
|
|
@ -1170,8 +1170,7 @@ app.put('/api/supplies/:id/edit', async (req, res) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
<<<<<<< Updated upstream |
|
|
|
======= |
|
|
|
|
|
|
|
// 处理媒体文件上传(图片和视频)
|
|
|
|
let uploadedImageUrls = []; |
|
|
|
if (Array.isArray(imageUrls) && imageUrls.length > 0) { |
|
|
|
@ -1216,20 +1215,20 @@ app.put('/api/supplies/:id/edit', async (req, res) => { |
|
|
|
console.log('媒体文件处理完成,成功上传', uploadedImageUrls.length, '个文件'); |
|
|
|
} |
|
|
|
|
|
|
|
>>>>>>> Stashed changes |
|
|
|
|
|
|
|
// 更新货源信息
|
|
|
|
const updateQuery = ` |
|
|
|
UPDATE products |
|
|
|
SET productName = ?, price = ?, quantity = ?, grossWeight = ?, |
|
|
|
yolk = ?, specification = ?, supplyStatus = ?, description = ?, region = ?, |
|
|
|
producting = ?, product_contact = ?, contact_phone = ? |
|
|
|
producting = ?, product_contact = ?, contact_phone = ?, imageUrls = ? |
|
|
|
WHERE id = ? |
|
|
|
`;
|
|
|
|
|
|
|
|
await connection.query(updateQuery, [ |
|
|
|
productName, price.toString(), parseInt(quantity), grossWeight, |
|
|
|
yolk, specification, supplyStatus, description, region, |
|
|
|
producting, productContact, contactPhone, productId |
|
|
|
producting, productContact, contactPhone, JSON.stringify(uploadedImageUrls), productId |
|
|
|
]); |
|
|
|
|
|
|
|
// 提交事务
|
|
|
|
|