From 440d8cbea12cb9e3e9c7a68fc2c659b37777a03a Mon Sep 17 00:00:00 2001 From: 付智勇 <fuzhiyong@efangtec.com> Date: Wed, 27 Sep 2017 20:12:51 +0800 Subject: [PATCH] no message --- routes/upload.js | 5 +++-- services/meetingService.js | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/routes/upload.js b/routes/upload.js index cce099a..fe4cd71 100644 --- a/routes/upload.js +++ b/routes/upload.js @@ -31,16 +31,17 @@ router.post('/upLoadDoc',uploaddemo, async (ctx, next) => { const businessId = ctx.query.businessId; const category = ctx.query.category; let w = await fs.rename(applacation.uploade+ctx.req.file.filename,applacation.uploade+ctx.req.file.originalname) + let path = 'http://localhost:10000/'+ctx.req.file.originalname attachmentData = { id:uuid.db32(), businessId:businessId, category:category, - path:'http://localhost:10000/'+ctx.req.file.originalname + path:path } let oldAttachment = await attachmentModel.findOne({where:{businessId:businessId}}) if(oldAttachment){ - let oldAttachment = await attachmentModel.update({path:'http://localhost:10000/'+ctx.req.file.originalname},{where:{businessId:businessId}}) + let oldAttachment = await attachmentModel.update({path:path},{where:{businessId:businessId}}) }else{ let attachment = await attachmentModel.create(attachmentData) } diff --git a/services/meetingService.js b/services/meetingService.js index 9c004b4..789792f 100644 --- a/services/meetingService.js +++ b/services/meetingService.js @@ -91,6 +91,14 @@ meetingService.prototype.getMeeting = async(queryData,page = 1,pageno =12) =>{ h5_Module AS h5Module, ( SELECT + path + FROM + 3m_attachment + WHERE + 3m_attachment.business_id = 3m_meeting.id + ) meetingPhoto, + ( + SELECT COUNT(*) FROM 3m_student_meeting -- libgit2 0.24.0