diff --git a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-sport-object/index.obj.js b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-sport-object/index.obj.js index d591335510737047e7e17fc39faa0aa4c2e391b5..f50ac6982c6aee3bb69b998e8aacdc11580421e6 100644 --- a/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-sport-object/index.obj.js +++ b/alpha/admin/uniCloud-aliyun/cloudfunctions/fe-sport-object/index.obj.js @@ -130,9 +130,16 @@ module.exports = { let cur = res.data[0][fieldName]; cur += event.distance - res = await collection.doc(event.userId).update({ - total_walking_distance: cur, - }) + if (event.type == "跑步") { + res = await collection.doc(event.userId).update({ + total_running_distance: cur + }) + } else { + res = await collection.doc(event.userId).update({ + total_walking_distance: cur + }) + } + if (res.updated > 0) return {