Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Wechat Projects
>
WeChat Applet/Game
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
19
Star
373
Fork
109
程序员阿鑫
/
微信报修小程序V4.1
Code
Issues
8
Pull Requests
0
Wiki
Insights
Pipelines
Service
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
getCampusInfo云函数index.js文件
Backlog
#I85KIG
将军
Opened this issue
2023-10-06 11:59
完整的包发过来了 这上面实在是不会提交代码。我改动了后也就是没有匿名提交评论了。 ``` // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) const db = cloud.database() const _ = db.command exports.main = async (event, context) => { const wxContext = cloud.getWXContext() if (event.action == 'getlist') { if( event.label =='全部'){ return await db.collection('s_info').where({ school_id: event.s_id }).orderBy('_createTime', 'desc').get() }else{ return await db.collection('s_info').where({ label: event.label, school_id: event.s_id }).orderBy('_createTime', 'desc').get() } } else if (event.action == 'getmylist') { if( event.label =='全部'){ return await db.collection('s_info').where({ _openid: event._openid }).orderBy('_createTime', 'desc').get() }else{ return await db.collection('s_info').where({ label: event.label, _openid: event._openid }).orderBy('_createTime', 'desc').get() } } else if (event.action == 'viewinfo') { return await db.collection('s_info').doc(event.info_id).update({ data: { view: _.inc(1) } }) } else if (event.action == 'addcomment') { return await db.collection('s_comment').add({ data: { info_id: event.info_id, comment: event.comment, nick_name: event.nick_name, avatar_url: event.avatar_url, _createTime: event._createTime, _openid: wxContext.OPENID, realName: event.realName,//为了评论出现名称头像等 logo: event.logo,//为了评论出现名称头像等 phone: event.phone,//为了评论出现名称头像等 } }) } else if (event.action == 'getcomment') { return await db.collection('s_comment').where({ info_id: event.info_id }).orderBy('_createTime', 'desc').get() } else if (event.action == 'deletecomment') { return await db.collection('s_comment').doc(event.comment_id).remove() } // if (event.action == 'getAll') { //获取所有未被接单的需求 // return await db.collection('w_misson').where({ // state: event.state // }).orderBy('_createTime', order).get() // } else if (event.action == 'getmisson') { // return await db.collection('w_misson').where({ // _openid: wxContext.OPENID, // state: event.state // }).orderBy('_createTime', order).get() // } else if (event.action == 'admingetmison') { // return await db.collection('w_misson').where({ // m_sid: event.sid, // state: event.state // }).orderBy('_createTime', order).get() // } else if (event.action == 'pass') { // let changeState = await db.collection('w_misson').doc(event._id) // .update({ // data: { // state: 1 //状态 通过 // } // }) // console.log(changeState) // if(changeState.stats && changeState.stats.updated > 0){ // let addmoney = await db.collection('w_userinfo').where({_openid:event.useropenid}) // .update({ // data: { // u_parse: _.inc(Number(event.realmoney)) // } // }) // console.log(addmoney,'addmondy') // if (addmoney.stats && addmoney.stats.updated > 0) { // let time = new Date().getTime() // let his = await db.collection('w_history').add({ // data: { // time: time , // type:'佣金入账', // mid: 'root', // money: '+'+ event.realmoney, // openid: event.useropenid // } // }) // return his // } // } // } else if (event.action == 'unpass') { // return await db.collection('w_misson').doc(event._id) // .update({ // data: { // state: 2 ,//状态 不通过 // reason: event.reason // } // }) // } } ```
完整的包发过来了 这上面实在是不会提交代码。我改动了后也就是没有匿名提交评论了。 ``` // 云函数入口文件 const cloud = require('wx-server-sdk') cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) const db = cloud.database() const _ = db.command exports.main = async (event, context) => { const wxContext = cloud.getWXContext() if (event.action == 'getlist') { if( event.label =='全部'){ return await db.collection('s_info').where({ school_id: event.s_id }).orderBy('_createTime', 'desc').get() }else{ return await db.collection('s_info').where({ label: event.label, school_id: event.s_id }).orderBy('_createTime', 'desc').get() } } else if (event.action == 'getmylist') { if( event.label =='全部'){ return await db.collection('s_info').where({ _openid: event._openid }).orderBy('_createTime', 'desc').get() }else{ return await db.collection('s_info').where({ label: event.label, _openid: event._openid }).orderBy('_createTime', 'desc').get() } } else if (event.action == 'viewinfo') { return await db.collection('s_info').doc(event.info_id).update({ data: { view: _.inc(1) } }) } else if (event.action == 'addcomment') { return await db.collection('s_comment').add({ data: { info_id: event.info_id, comment: event.comment, nick_name: event.nick_name, avatar_url: event.avatar_url, _createTime: event._createTime, _openid: wxContext.OPENID, realName: event.realName,//为了评论出现名称头像等 logo: event.logo,//为了评论出现名称头像等 phone: event.phone,//为了评论出现名称头像等 } }) } else if (event.action == 'getcomment') { return await db.collection('s_comment').where({ info_id: event.info_id }).orderBy('_createTime', 'desc').get() } else if (event.action == 'deletecomment') { return await db.collection('s_comment').doc(event.comment_id).remove() } // if (event.action == 'getAll') { //获取所有未被接单的需求 // return await db.collection('w_misson').where({ // state: event.state // }).orderBy('_createTime', order).get() // } else if (event.action == 'getmisson') { // return await db.collection('w_misson').where({ // _openid: wxContext.OPENID, // state: event.state // }).orderBy('_createTime', order).get() // } else if (event.action == 'admingetmison') { // return await db.collection('w_misson').where({ // m_sid: event.sid, // state: event.state // }).orderBy('_createTime', order).get() // } else if (event.action == 'pass') { // let changeState = await db.collection('w_misson').doc(event._id) // .update({ // data: { // state: 1 //状态 通过 // } // }) // console.log(changeState) // if(changeState.stats && changeState.stats.updated > 0){ // let addmoney = await db.collection('w_userinfo').where({_openid:event.useropenid}) // .update({ // data: { // u_parse: _.inc(Number(event.realmoney)) // } // }) // console.log(addmoney,'addmondy') // if (addmoney.stats && addmoney.stats.updated > 0) { // let time = new Date().getTime() // let his = await db.collection('w_history').add({ // data: { // time: time , // type:'佣金入账', // mid: 'root', // money: '+'+ event.realmoney, // openid: event.useropenid // } // }) // return his // } // } // } else if (event.action == 'unpass') { // return await db.collection('w_misson').doc(event._id) // .update({ // data: { // state: 2 ,//状态 不通过 // reason: event.reason // } // }) // } } ```
Comments (
1
)
Sign in
to comment
Status
Backlog
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
No related branch
master
cxyax
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(1)
JavaScript
1
https://gitee.com/cxyax/WeChatComputer-roomMaintenance.git
git@gitee.com:cxyax/WeChatComputer-roomMaintenance.git
cxyax
WeChatComputer-roomMaintenance
微信报修小程序V4.1
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register