[僅限PaaS]{class="badge informative" title="僅適用於雲端專案(Adobe管理的PaaS基礎結構)和內部部署專案的Adobe Commerce 。"}
sales_order資料表
sales_order資料表(sales_flat_order在M1)是擷取每個訂單的位置。 雖然Commerce有一些自訂實作,會導致將訂單分割為個別的列,但通常每一列代表一個不重複的順序。
此表格包含所有客戶訂單,無論該訂單是否透過訪客結帳處理。 如果您的商店接受訪客結帳,您可以找到有關此使用案例的更多資訊。
通用欄
資料行名稱
描述
base_currency_code在
base_*欄位中擷取的所有值的貨幣(即base_grand_total、base_subtotal等)。 這通常會反映Commerce商店的預設貨幣base_discount_amount套用至訂單的折扣值
base_grand_total套用所有稅捐、運費和折扣後,客戶在訂單上支付的最終價格。 雖然精確計算是可自訂的,但一般
base_grand_total的計算方式為base_subtotal + base_tax_amount + base_shipping_amount + base_discount_amount - base_gift_cards_amount - base_customer_balance_amountbase_subtotal訂單中包含之所有專案的商品總值。 不包含稅金、運費、折扣等
base_shipping_amount套用至訂單的送貨值
base_tax_amount套用至訂單的稅捐值
billing_address_id與
Foreign key資料表關聯的sales_order_address。 加入sales_order_address.entity_id以決定與訂單相關聯的帳單地址詳細資料coupon_code適用於訂單的優惠券。 若未套用任何抵用券,此欄位為
NULLcreated_at訂單的建立時間戳記,以UTC儲存在本機。 視您在Commerce Intelligence中的設定而定,此時間戳記可能會轉換為Commerce Intelligence中與您的資料庫時區不同的報表時區
customer_email下訂單客戶的電子郵件地址。 所有情況下都會填入此值,包括透過訪客結帳處理的訂單
customer_group_id與
customer_group資料表相關聯的外部索引鍵。 加入customer_group.customer_group_id以決定與訂單相關聯的客戶群組customer_id與
Foreign key資料表關聯的customer_entity (如果客戶已註冊)。 加入customer_entity.entity_id以決定與訂單相關聯的客戶屬性。 如果訂單是透過訪客結帳下單,則此欄位為NULLentity_id (PK)表格的唯一識別碼,常用於聯結Commerce執行個體內其他表格
increment_id訂單的唯一識別碼,在Adobe Commerce中通常稱為
order_id。 increment_id最常用於聯結至外部來源,例如Google Ecommerceshipping_address_id與
sales_order_address資料表相關聯的外部索引鍵。 加入sales_order_address.entity_id以決定與訂單關聯的送貨地址詳細資料status訂單的狀態。 可能會傳回「完成」、「處理」、「已取消」、「已退款」等值,以及在Commerce執行個體上實作的任何自訂狀態。 訂單處理時可能會有所變更
store_id與
Foreign key資料表關聯的store。 加入store。store_id以判斷與訂單相關聯的Commerce商店檢視通用計算欄
資料行名稱
描述
Billing address city訂單的帳單城市。 透過加入
sales_order計算。billing_address_id至sales_order_address。entity_id並傳回city欄位Billing address country訂單的帳單國家/地區代碼。 透過加入
sales_order計算。billing_address_id至sales_order_address。entity_id並傳回country_idBilling address region訂單的帳單區域(通常為州或省)。 透過加入
sales_order計算。billing_address_id至sales_order_address。entity_id並傳回region欄位Customer's first order date此客戶下第一個訂單的時間戳記。 通常被認為是客戶的「贏取日期」。 透過傳回最小值
sales_order計算。每個唯一客戶的created_at值Customer's first order's billing region下訂單之客戶的贏取帳單區域。 傳回與客戶第一筆訂單相關聯的
Billing address region進行計算Customer's first order's coupon_code下此訂單的客戶的贏取優惠券代碼。 傳回與客戶第一筆訂單相關聯的
coupon_code進行計算Customer's group code下此訂單的客戶的群組名稱。 透過加入
sales_order計算。customer_group_id至customer_group。customer_group_id並傳回customer_group_code欄位Customer's lifetime number of coupons套用至此客戶所有訂單的優惠券總數。 計算每個唯一客戶的
coupon_code不是NULL的訂單數Customer's lifetime number of orders此客戶下單的訂單總數。 計算方式為計算
sales_order表格中每個唯一客戶的列數Customer's lifetime revenue此客戶下所有訂單的收入總和。 計算方式為加總每個唯一客戶之所有訂單的
base_grand_total欄位Customer's order number此客戶訂單的循序訂單排名。 透過識別客戶下的所有訂單、依
created_at時間戳記依遞增順序排序,並為每個訂單指派遞增整數值進行計算。 例如,客戶的第一個訂單傳回Customer's order number (共1個),客戶的第二個訂單傳回Customer's order number (共2個),依此類推。Customer's order number (previous-current)客戶先前訂單的排名與此訂單的排名串連,以
-字元分隔。 計算方式為將("Customer's order number - 1")與"-"串連,然後是"Customer's order number"。 例如,對於與客戶第二次購買相關聯的訂單,此欄會傳回1-2的值。 最常用於表示兩個訂單事件之間的時間(即在「訂單之間的時間」圖表中)Is customer's last order?決定訂單是否對應至客戶的上次或最近訂單。 比較
Customer's order number值與Customer's lifetime number of orders進行計算。 當這兩個欄位在指定的順序中相等時,此欄會傳回Yes;否則會傳回NoNumber of items in order訂單中包含的料號總數。 透過加入
sales_order計算。entity_id至sales_order_item。order_id並加總sales_order_item。qty_ordered欄位Seconds between customer's first order date and this order此訂單與客戶第一筆訂單之間的經過時間。 計算方式為從每個訂單的
Customer's first order date中減去created_at,並以整數秒數傳回Seconds since previous order此訂單與客戶之前訂單之間經過的時間。 計算方式是將此順序的
created_at減去先前順序的created_at,傳回為整數秒數。 例如,針對與客戶第三筆訂單相對應的訂單記錄,此欄會傳回客戶第二筆訂單與第三筆訂單之間的秒數。 對於客戶的第一筆訂單,此欄位會傳回NULLShipping address city訂單的送貨城市。 透過加入
sales_order計算。shipping_address_id至sales_order_address。entity_id並傳回city欄位Shipping address country訂單的出貨國家/地區代碼。 透過加入
sales_order計算。Shipping_address_id至sales_order_address。entity_id並傳回country_idShipping address region訂單的送貨地區(通常為州或省)。 透過加入
sales_order計算。shipping_address_id至sales_order_address。entity_id並傳回region欄位Store name與此訂單相關聯的Commerce商店名稱。 透過加入
sales_order計算。store_id至store。store_id並傳回name欄位通用量度
量度名稱
描述
建構
Avg order value每筆訂單的平均收入,其中收入定義為
base_grand_totalOperation: AverageOperand: base_grand_totalTimestamp: created_atAvg time between orders客戶的(n-1)訂單與所有客戶和訂單的第n筆訂單之間的平均時間
Operation: AverageOperand: Seconds since previous orderTimestamp: created_atGMV在套用所有稅捐與折扣之前,所有訂單的商品總值(其中GMV定義為小計)
Operation: SumOperand: base_subtotalTimestamp: created_atMedian time between orders適用於所有客戶和訂單的客戶(n-1)訂單與第n筆訂單之間的中位時間
Operation: MedianOperand: Seconds since previous orderTimestamp: created_atOrders訂購總數
Operation: CountOperand: entity_idTimestamp: created_atRevenue所有訂單的收入總和,其中收入定義為客戶支付的最終價格,扣除所有稅捐、折扣、出貨等之後予以套用
Operation: SumOperand: base_grand_totalTimestamp: created_atShipping所有訂單的出貨金額總和
Operation: SumOperand: base_shipping_amountTimestamp: created_atTax套用至所有訂單的稅額總和
Operation: SumOperand: base_tax_amountTimestamp: created_atUnique Customers在指定的報告時間間隔內下訂單的不重複客戶數。 例如,如果報表的間隔為每週,則在指定周內至少下過一次訂單的每位客戶都會計算一次,無論該周內的訂單數量為何
Operation: Count DistinctOperand: customer_emailTimestamp: created_atForeign Key個加入路徑
customer_entity
- 加入
customer_entity表格以建立與下訂單的客戶相關聯的新客戶層級欄。- 路徑:
sales_order.customer_id(許多) =>customer_entity.entity_id(一個)
- 路徑:
customer_group
- 加入
customer_group資料表以建立傳回下訂單之客戶的客戶群組名稱的資料行。- 路徑:
sales_order.customer_group_id(許多) =>customer_group.customer_group_id(一個)
- 路徑:
sales_order_address
-
加入
sales_order_address資料表以建立傳回與訂單相關之帳單與出貨地點的資料行。 視需要帳單或送貨詳細資料而定,可能會有兩個聯結路徑。-
路徑:
- 送貨:
sales_order.shipping_address_id(許多) =>sales_order_address.entity_id(一個) - 帳單:
sales_order.billing_address_id(許多) =>sales_order_address.entity_id(一個)
- 送貨:
-
store
- 加入
store資料表以建立資料行,這些資料行會傳回與訂單相關聯的Commerce存放區相關的詳細資料。- 路徑:
sales_order.store_id(許多) =>store.store_id(一個)
- 路徑:
recommendation-more-help
e1f8a7e8-8cc7-4c99-9697-b1daa1d66dbc