付智勇

no message

... ... @@ -48,7 +48,7 @@ router.post('/upLoadDoc',uploaddemo, async (ctx, next) => {
}else {
let oldAttachment2one = await attachmentModel.findOne({where:{businessId:businessId,category:2,siteId:siteId}})
if(oldAttachment2one){
let oldAttachment = await attachmentModel.update({path:path},{where:{businessId:businessId,category:2,siteId:siteId}})
let oldAttachment = await attachmentModel.update({path:path},{where:{id:oldAttachment2one.id}})
}else{
let attachment = await attachmentModel.create(attachmentData)
}
... ... @@ -85,6 +85,20 @@ router.post('/getImgBySiteId',async(ctx, next)=>{
status.catchError(ctx,400,e.message);
}
})
router.post('/getImgBySiteId',async(ctx, next)=>{
try{
let img = await attachmentModel.findAll({
where:{
siteId:ctx.request.body.siteId,
category:2
}
});
status.successTemp(ctx,200,img);
}catch(e){
console.log(e)
status.catchError(ctx,400,e.message);
}
})
router.post('/tgpCallback', async (ctx, next) => {
... ...