cangku/backend/model/Orders.js

112 lines
1.8 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Cube.js 数据模型 - 订单快递详情
// 基于 jst_order_express_details 表
cube(`Orders`, {
sql: `SELECT * FROM rpt.jst_order_express_details`,
// measures(指标)
measures: {
count: {
sql: `id`,
type: `count`,
},
totalWeight: {
sql: `weight`,
type: `sum`,
},
avgWeight: {
sql: `weight`,
type: `avg`,
},
},
// dimensions(维度)
dimensions: {
id: {
sql: `id`,
type: `number`,
primaryKey: true,
},
soId: {
sql: `so_id`,
type: `string`,
title: `线上订单号`,
},
logisticId: {
sql: `logistic_id`,
type: `string`,
title: `物流单号`,
},
logisticCompanyName: {
sql: `logistic_company_name`,
type: `string`,
title: `物流公司`,
},
logisticStatusName: {
sql: `logistic_status_name`,
type: `string`,
title: `物流状态`,
},
orderStatusName: {
sql: `order_status_name`,
type: `string`,
title: `订单状态`,
},
shopName: {
sql: `shop_name`,
type: `string`,
title: `店铺名称`,
},
platformName: {
sql: `platform_name`,
type: `string`,
title: `平台`,
},
warehouseName: {
sql: `warehouse_name`,
type: `string`,
title: `发货仓`,
},
receiverAddress: {
sql: `receiver_address`,
type: `string`,
title: `收货省市区`,
},
payTime: {
sql: `pay_time`,
type: `time`,
title: `支付时间`,
},
sendTime: {
sql: `send_time`,
type: `time`,
title: `发货时间`,
},
signTime: {
sql: `sign_time`,
type: `time`,
title: `签收时间`,
},
createdAt: {
sql: `createdAt`,
type: `time`,
title: `创建时间`,
},
},
});