Browse Source

修复收藏页面只显示一个数据的问题

pull/12/head
徐飞洋 2 months ago
parent
commit
dcf03b1418
  1. 3
      server-example/server-mysql.js

3
server-example/server-mysql.js

@ -3794,7 +3794,8 @@ app.post('/api/favorites/list', async (req, res) => {
{
model: Product,
as: 'Product', // 与关联定义中的别名一致
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'],
required: false // 使用LEFT JOIN,即使商品不存在也会返回收藏记录
}
],
order: [['date', 'DESC']]

Loading…
Cancel
Save