webadmin端增加商铺日志
This commit is contained in:
@@ -603,4 +603,21 @@ CREATE TABLE log_user_analytics (
|
||||
KEY idx_log_user_analytics_ref (ref_type, ref_id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户行为埋点日志';
|
||||
|
||||
DROP TABLE IF EXISTS log_store_analytics;
|
||||
CREATE TABLE log_store_analytics (
|
||||
id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
store_account_id BIGINT UNSIGNED DEFAULT NULL COMMENT '门店账号ID,系统/HQ操作可为NULL',
|
||||
store_id BIGINT UNSIGNED NOT NULL COMMENT '门店ID',
|
||||
event_name VARCHAR(64) NOT NULL COMMENT '门店行为事件名',
|
||||
client_app VARCHAR(32) DEFAULT NULL COMMENT 'SHOP_H5|HQ_WEB|PARTNER_H5',
|
||||
ref_type VARCHAR(32) DEFAULT NULL COMMENT 'REDEEM_RECORD|STORE_PAYOUT|...',
|
||||
ref_id BIGINT UNSIGNED DEFAULT NULL,
|
||||
extra_json JSON DEFAULT NULL,
|
||||
created_at DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
|
||||
PRIMARY KEY (id),
|
||||
KEY idx_log_store_analytics_store_created (store_id, created_at),
|
||||
KEY idx_log_store_analytics_account_created (store_account_id, created_at),
|
||||
KEY idx_log_store_analytics_event_created (event_name, created_at)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='门店商户行为日志';
|
||||
|
||||
SET FOREIGN_KEY_CHECKS = 1;
|
||||
@@ -872,3 +872,20 @@ model LogUserAnalytics {
|
||||
@@index([refType, refId])
|
||||
@@map("log_user_analytics")
|
||||
}
|
||||
|
||||
model LogStoreAnalytics {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
storeAccountId BigInt? @map("store_account_id") @db.UnsignedBigInt
|
||||
storeId BigInt @map("store_id") @db.UnsignedBigInt
|
||||
eventName String @map("event_name") @db.VarChar(64)
|
||||
clientApp ClientApp? @map("client_app")
|
||||
refType String? @map("ref_type") @db.VarChar(32)
|
||||
refId BigInt? @map("ref_id") @db.UnsignedBigInt
|
||||
extraJson Json? @map("extra_json")
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.DateTime(3)
|
||||
|
||||
@@index([storeId, createdAt])
|
||||
@@index([storeAccountId, createdAt])
|
||||
@@index([eventName, createdAt])
|
||||
@@map("log_store_analytics")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user