Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
付智勇
/
koa2_Sequelize_project
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
付智勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
440d8cbea12cb9e3e9c7a68fc2c659b37777a03a
440d8cbe
1 parent
1a951ab9
no message
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
11 行增加
和
2 行删除
routes/upload.js
services/meetingService.js
routes/upload.js
查看文件 @
440d8cb
...
...
@@ -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
)
}
...
...
services/meetingService.js
查看文件 @
440d8cb
...
...
@@ -91,6 +91,14 @@ meetingService.prototype.getMeeting = async(queryData,page = 1,pageno =12) =>{
h5_Module
AS
h5Module
,
(
SELECT
path
FROM
3
m_attachment
WHERE
3
m_attachment
.
business_id
=
3
m_meeting
.
id
)
meetingPhoto
,
(
SELECT
COUNT
(
*
)
FROM
3
m_student_meeting
...
...
请
注册
或
登录
后发表评论