From 6f3845f57ef20db4414407ccd92a7d3782a8cf87 Mon Sep 17 00:00:00 2001 From: phoooob <1162762894@qq.com> Date: Wed, 2 Sep 2020 10:00:12 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=A4=A7=E8=AE=A2?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collection/opendb-base-order/collection.json | 170 +++++++++++++++++++ collection/opendb-base-order/package.json | 17 ++ database/uni-id/db_init.json | 3 +- 3 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 collection/opendb-base-order/collection.json create mode 100644 collection/opendb-base-order/package.json diff --git a/collection/opendb-base-order/collection.json b/collection/opendb-base-order/collection.json new file mode 100644 index 0000000..33ca356 --- /dev/null +++ b/collection/opendb-base-order/collection.json @@ -0,0 +1,170 @@ +{ + "schema": { + "bsonType": "object", + "required": [], + "properties": { + "_id": { + "description": "存储文档 ID(统一订单 ID),系统自动生成" + }, + "title": { + "bsonType": "string", + "description": "商品标题" + }, + "type": { + "bsonType": "string", + "description": "订单类型,如商品订单,会员订单,充值订单等" + }, + "payType": { + "bsonType": "string", + "description": "支付渠道,wxpay | alipay" + }, + "totalFee": { + "bsonType": "float", + "description": "订单总金额,单位:元。" + }, + "userId": { + "bsonType": "String", + "description": "下单用户ID,uni-id-users表" + }, + "platform": { + "bsonType": "String", + "description": "下单平台类型:h5、mp-weixin、mp-alipay、app-plus等" + }, + "uniAppId": { + "bsonType": "String", + "description": "uni-app项目的appid" + }, + "status": { + "bsonType": "int", + "minimum": -1, + "maximum": 2, + "description": "订单状态,1:待付款,2:已付款,-1已取消" + }, + "refundStatus": { + "bsonType": "int", + "minimum": -3, + "maximum": 3, + "description": "订单退款状态,1:退款审核中,2:退款中,3:已退款,-1:退款拒绝,-2:退款失败,-3:退款取消" + }, + "isRefund": { + "bsonType": "boolean", + "description": "是否是退款订单" + }, + "refundAmount": { + "bsonType": "float", + "description": "退款金额(非退款订单表示已退款总金额,退款订单表示该笔退款的退款金额),单位:元" + }, + "refundCount": { + "bsonType": "int", + "description": "总退款笔数(非退款订单有值)" + }, + "createTime": { + "bsonType": "timestamp", + "description": "订单创建时间/发起退款时间" + }, + "updateTime": { + "bsonType": "timestamp", + "description": "订单更新时间" + }, + "paidTime": { + "bsonType": "timestamp", + "description": "订单付款时间" + }, + "refundTime": { + "bsonType": "timestamp", + "description": "订单完成退款时间" + }, + "refundDesc": { + "bsonType": "String", + "description": "退款原因" + }, + "transactionId": { + "bsonType": "String", + "description": "微信或支付宝交易单号" + }, + "info": { + "bsonType": "string", + "description": "自定义的订单拓展信息,如商品信息、会员卡种类信息等" + } + } + }, + "data": [], + "index": [{ + "IndexName": "type", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "type", + "Direction": "1" + }], + "MgoIsUnique": false + } + }, { + "IndexName": "userId", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "userId", + "Direction": "1" + }], + "MgoIsUnique": false + } + }, { + "IndexName": "payType", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "payType", + "Direction": "1" + }], + "MgoIsUnique": false + } + }, + { + "IndexName": "status", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "status", + "Direction": "1" + }], + "MgoIsUnique": false + } + }, + { + "IndexName": "refundStatus", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "refundStatus", + "Direction": "1" + }], + "MgoIsUnique": false + } + }, + { + "IndexName": "isRefund", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "isRefund", + "Direction": "1" + }], + "MgoIsUnique": false + } + }, + { + "IndexName": "transactionId", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "transactionId", + "Direction": "1" + }], + "MgoIsUnique": false + } + }, + { + "IndexName": "createTime", + "MgoKeySchema": { + "MgoIndexKeys": [{ + "Name": "createTime", + "Direction": "1" + }], + "MgoIsUnique": false + } + }] +} diff --git a/collection/opendb-base-order/package.json b/collection/opendb-base-order/package.json new file mode 100644 index 0000000..2e0213d --- /dev/null +++ b/collection/opendb-base-order/package.json @@ -0,0 +1,17 @@ +{ + "name": "@opendb/opendb-base-order", + "version": "0.0.1", + "description": "统一订单数据表,完成与支付相关的业务", + "keywords": ["base-order", "统一订单","大订单","跨平台", "多应用","支付宝","微信","退款","支付"], + "opendb": { + "title": "大订单", + "type": "collection", + "contributors": [ + { + "name": "BaseCloud", + "email": "", + "homepage": "https://gitee.com/dcloud/opendb" + } + ] + } +} diff --git a/database/uni-id/db_init.json b/database/uni-id/db_init.json index 8f08934..fc69f55 100644 --- a/database/uni-id/db_init.json +++ b/database/uni-id/db_init.json @@ -1,3 +1,4 @@ { - "uni-id-users": {} + "uni-id-users": {}, + "open-base-order":{} } -- Gitee From 69db5cc88f5448f7c8c1247462fdca867dfbd234 Mon Sep 17 00:00:00 2001 From: phoooob <1162762894@qq.com> Date: Wed, 2 Sep 2020 10:21:10 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=90=88=E5=B9=B6refundStatus=E5=88=B0stat?= =?UTF-8?q?us=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collection/opendb-base-order/collection.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/collection/opendb-base-order/collection.json b/collection/opendb-base-order/collection.json index 33ca356..d554380 100644 --- a/collection/opendb-base-order/collection.json +++ b/collection/opendb-base-order/collection.json @@ -35,16 +35,10 @@ "description": "uni-app项目的appid" }, "status": { - "bsonType": "int", - "minimum": -1, - "maximum": 2, - "description": "订单状态,1:待付款,2:已付款,-1已取消" - }, - "refundStatus": { "bsonType": "int", "minimum": -3, - "maximum": 3, - "description": "订单退款状态,1:退款审核中,2:退款中,3:已退款,-1:退款拒绝,-2:退款失败,-3:退款取消" + "maximum": 5, + "description": "订单状态,1:待付款,2:已付款,3:退款审核中,4:退款中,5:已退款,-1已取消付款/退款,-2:退款拒绝,-3:退款失败" }, "isRefund": { "bsonType": "boolean", -- Gitee From 1bd902f2bf210810949bfa8c219bf626b6fd63a8 Mon Sep 17 00:00:00 2001 From: phoooob <1162762894@qq.com> Date: Wed, 2 Sep 2020 10:24:20 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=B3=E8=81=94?= =?UTF-8?q?=E8=A1=A8=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- database/uni-id/db_init.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/uni-id/db_init.json b/database/uni-id/db_init.json index fc69f55..2ce7dea 100644 --- a/database/uni-id/db_init.json +++ b/database/uni-id/db_init.json @@ -1,4 +1,4 @@ { "uni-id-users": {}, - "open-base-order":{} + "opendb-base-order":{} } -- Gitee From 9cb379dd220499495bf8be3eeb7bb78247ca6550 Mon Sep 17 00:00:00 2001 From: phoooob <1162762894@qq.com> Date: Wed, 2 Sep 2020 14:32:04 +0800 Subject: [PATCH 4/5] contributorInfo --- collection/opendb-base-order/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collection/opendb-base-order/package.json b/collection/opendb-base-order/package.json index 2e0213d..e00aeff 100644 --- a/collection/opendb-base-order/package.json +++ b/collection/opendb-base-order/package.json @@ -9,8 +9,8 @@ "contributors": [ { "name": "BaseCloud", - "email": "", - "homepage": "https://gitee.com/dcloud/opendb" + "email": "1162762894@qq.com", + "homepage": "https://ext.dcloud.net.cn/plugin?id=2668" } ] } -- Gitee From 2671dc3a2829d9de8ea10d764a35d35b3da13a07 Mon Sep 17 00:00:00 2001 From: phoooob <1162762894@qq.com> Date: Thu, 3 Sep 2020 09:07:44 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E9=87=91=E9=A2=9D=E6=94=B9=E4=B8=BAint?= =?UTF-8?q?=EF=BC=8C=E5=AD=97=E6=AE=B5=E6=94=B9=E4=B8=BA=E4=B8=8B=E5=88=92?= =?UTF-8?q?=E7=BA=BF=EF=BC=8C=E5=88=A0=E9=99=A4uni=5Fappid=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- collection/opendb-base-order/collection.json | 36 ++++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/collection/opendb-base-order/collection.json b/collection/opendb-base-order/collection.json index d554380..874f796 100644 --- a/collection/opendb-base-order/collection.json +++ b/collection/opendb-base-order/collection.json @@ -14,15 +14,15 @@ "bsonType": "string", "description": "订单类型,如商品订单,会员订单,充值订单等" }, - "payType": { + "pay_type": { "bsonType": "string", "description": "支付渠道,wxpay | alipay" }, - "totalFee": { - "bsonType": "float", - "description": "订单总金额,单位:元。" + "total_fee": { + "bsonType": "int", + "description": "订单总金额,单位:分。" }, - "userId": { + "user_id": { "bsonType": "String", "description": "下单用户ID,uni-id-users表" }, @@ -30,49 +30,49 @@ "bsonType": "String", "description": "下单平台类型:h5、mp-weixin、mp-alipay、app-plus等" }, - "uniAppId": { - "bsonType": "String", - "description": "uni-app项目的appid" - }, + // "uni_appid": { //如需适配单平台多应用可拓展此字段 + // "bsonType": "String", + // "description": "uni-app项目的appid" + // }, "status": { "bsonType": "int", "minimum": -3, "maximum": 5, "description": "订单状态,1:待付款,2:已付款,3:退款审核中,4:退款中,5:已退款,-1已取消付款/退款,-2:退款拒绝,-3:退款失败" }, - "isRefund": { + "is_refund": { "bsonType": "boolean", "description": "是否是退款订单" }, - "refundAmount": { + "refund_amount": { "bsonType": "float", "description": "退款金额(非退款订单表示已退款总金额,退款订单表示该笔退款的退款金额),单位:元" }, - "refundCount": { + "refund_count": { "bsonType": "int", "description": "总退款笔数(非退款订单有值)" }, - "createTime": { + "create_time": { "bsonType": "timestamp", "description": "订单创建时间/发起退款时间" }, - "updateTime": { + "update_time": { "bsonType": "timestamp", "description": "订单更新时间" }, - "paidTime": { + "paid_time": { "bsonType": "timestamp", "description": "订单付款时间" }, - "refundTime": { + "refund_time": { "bsonType": "timestamp", "description": "订单完成退款时间" }, - "refundDesc": { + "refund_desc": { "bsonType": "String", "description": "退款原因" }, - "transactionId": { + "transaction_id": { "bsonType": "String", "description": "微信或支付宝交易单号" }, -- Gitee