正在显示
2 个修改的文件
包含
11 行增加
和
2 行删除
@@ -31,16 +31,17 @@ router.post('/upLoadDoc',uploaddemo, async (ctx, next) => { | @@ -31,16 +31,17 @@ router.post('/upLoadDoc',uploaddemo, async (ctx, next) => { | ||
31 | const businessId = ctx.query.businessId; | 31 | const businessId = ctx.query.businessId; |
32 | const category = ctx.query.category; | 32 | const category = ctx.query.category; |
33 | let w = await fs.rename(applacation.uploade+ctx.req.file.filename,applacation.uploade+ctx.req.file.originalname) | 33 | let w = await fs.rename(applacation.uploade+ctx.req.file.filename,applacation.uploade+ctx.req.file.originalname) |
34 | + let path = 'http://localhost:10000/'+ctx.req.file.originalname | ||
34 | attachmentData = { | 35 | attachmentData = { |
35 | id:uuid.db32(), | 36 | id:uuid.db32(), |
36 | businessId:businessId, | 37 | businessId:businessId, |
37 | category:category, | 38 | category:category, |
38 | - path:'http://localhost:10000/'+ctx.req.file.originalname | 39 | + path:path |
39 | } | 40 | } |
40 | let oldAttachment = await attachmentModel.findOne({where:{businessId:businessId}}) | 41 | let oldAttachment = await attachmentModel.findOne({where:{businessId:businessId}}) |
41 | 42 | ||
42 | if(oldAttachment){ | 43 | if(oldAttachment){ |
43 | - let oldAttachment = await attachmentModel.update({path:'http://localhost:10000/'+ctx.req.file.originalname},{where:{businessId:businessId}}) | 44 | + let oldAttachment = await attachmentModel.update({path:path},{where:{businessId:businessId}}) |
44 | }else{ | 45 | }else{ |
45 | let attachment = await attachmentModel.create(attachmentData) | 46 | let attachment = await attachmentModel.create(attachmentData) |
46 | } | 47 | } |
@@ -91,6 +91,14 @@ meetingService.prototype.getMeeting = async(queryData,page = 1,pageno =12) =>{ | @@ -91,6 +91,14 @@ meetingService.prototype.getMeeting = async(queryData,page = 1,pageno =12) =>{ | ||
91 | h5_Module AS h5Module, | 91 | h5_Module AS h5Module, |
92 | ( | 92 | ( |
93 | SELECT | 93 | SELECT |
94 | + path | ||
95 | + FROM | ||
96 | + 3m_attachment | ||
97 | + WHERE | ||
98 | + 3m_attachment.business_id = 3m_meeting.id | ||
99 | + ) meetingPhoto, | ||
100 | + ( | ||
101 | + SELECT | ||
94 | COUNT(*) | 102 | COUNT(*) |
95 | FROM | 103 | FROM |
96 | 3m_student_meeting | 104 | 3m_student_meeting |
-
请 注册 或 登录 后发表评论