[ 'enabled' => filter_var(env('BUSINESS_CLICKHOUSE_ENABLED', false), FILTER_VALIDATE_BOOL), 'url' => env('BUSINESS_CLICKHOUSE_URL', 'http://clickhouse:8123'), 'database' => env('BUSINESS_CLICKHOUSE_DATABASE', 'caiwu_business_analytics'), 'username' => env('BUSINESS_CLICKHOUSE_USERNAME', 'caiwu_app'), 'password' => env('BUSINESS_CLICKHOUSE_PASSWORD', ''), 'connect_timeout_seconds' => (float) env('BUSINESS_CLICKHOUSE_CONNECT_TIMEOUT', 3), 'query_timeout_seconds' => (float) env('BUSINESS_CLICKHOUSE_QUERY_TIMEOUT', 30), 'stream_timeout_seconds' => (float) env('BUSINESS_CLICKHOUSE_STREAM_TIMEOUT', 1800), ], 'archive' => [ 'disk' => env('BUSINESS_DATA_ARCHIVE_DISK', 'business_uploads_qiniu'), 'prefix' => trim((string) env('BUSINESS_DATA_ARCHIVE_PREFIX', 'business-data-archive'), '/'), ], /* * Every code-owned dataset in config/upstream_mirrors.php is classified. * `sync` values: * - always: keep the existing central incremental sync running; * - after_columnar_activation: do not grow MariaDB before a columnar * generation has been verified and activated; * - disabled: no current page consumes the dataset; retain/archive the * existing table, but do not keep querying the upstream source. */ 'datasets' => [ // Small organization and catalog dimensions stay in MariaDB. 'operations_replica.rpt.fys_companyInfo' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '公司资料'], 'operations_replica.rpt.fys_shopInfo' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '店铺资料/店铺报表'], 'operations_replica.rpt.fys_TrademarkInfo' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '商标资料'], 'operations_replica.rpt.crawl_shop_company' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '店铺基础信息/店铺主体期间'], 'operations_replica.rpt.jst_sku' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '商品资料/售后费用'], 'jiansun.dbo.pm_priceAdjustment' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '普通商品资料/工作平台价格'], 'operations_replica.rpt.jst_warehouseInfo' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '售后费用'], 'operations_replica.rpt.jst_shopInfo' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '预留聚水潭店铺维表'], // Large analytical facts move to ClickHouse after a MariaDB backfill. 'operations_replica.rpt.jst_Orders' => [ 'role' => 'fact', 'target_store' => 'clickhouse', 'consumer' => '售后费用', 'partition_column' => 'order_date', 'activation_group' => 'order-analysis', ], 'operations_replica.rpt.jst_OrderItem' => [ 'role' => 'fact', 'target_store' => 'clickhouse', 'consumer' => '售后费用', 'activation_group' => 'order-analysis', ], 'operations_replica.rpt.ads_itemid_sales_cost_ratio_v2_di' => [ 'role' => 'fact', 'target_store' => 'clickhouse', 'consumer' => '推广费用', 'partition_column' => 'stat_date', 'activation_group' => 'promotion-analysis', ], 'operations_replica.rpt.jst_returnAndRefundInfo' => [ 'role' => 'fact', 'target_store' => 'clickhouse', 'consumer' => '售后费用/非京喜退款', 'partition_column' => 'as_date', 'activation_group' => 'order-analysis', ], 'operations_replica.rpt.jst_returnAndRefundItem' => [ 'role' => 'fact', 'target_store' => 'clickhouse', 'consumer' => '售后费用/非京喜退款', 'activation_group' => 'order-analysis', ], 'operations_replica.rpt.jst_originalBillInfo' => [ 'role' => 'fact', 'target_store' => 'clickhouse', 'consumer' => '店铺收款账户·淘系支付宝账单', 'partition_column' => 'fee_time', 'sync' => 'always', ], // 淘系(天猫/淘宝)订单与售后:聚水潭 qmcust 表族,订单售后费用明细页需要与 // jst_Orders 系列合并读取,因此保持常规同步(不等待列式库启用)。 'operations_replica.rpt.jst_qmcust_orderlist' => [ 'role' => 'fact', 'target_store' => 'mariadb', 'consumer' => '订单售后费用明细·淘系订单', 'partition_column' => 'order_date', 'sync' => 'always', ], 'operations_replica.rpt.jst_qmcust_orderlist_item' => [ 'role' => 'fact', 'target_store' => 'mariadb', 'consumer' => '订单售后费用明细·淘系订单明细', 'sync' => 'always', ], 'operations_replica.rpt.jst_qmcust_refundlist' => [ 'role' => 'fact', 'target_store' => 'mariadb', 'consumer' => '订单售后费用明细·淘系售后', 'partition_column' => 'as_date', 'sync' => 'always', ], 'operations_replica.rpt.jst_qmcust_refundlist_item' => [ 'role' => 'fact', 'target_store' => 'mariadb', 'consumer' => '订单售后费用明细·淘系售后明细', 'sync' => 'always', ], // This 20M+ row mapping is not queried by the current promotion page. // Keep/archive its existing data, but stop upstream refresh immediately. 'operations_replica.rpt.jst_skumap' => [ 'role' => 'archive_only', 'target_store' => 'parquet', 'consumer' => '当前无页面读取', 'sync' => 'disabled', ], // Work orders are current-state operational data and remain row-store. 'operations_replica.rpt.work_order_main' => ['role' => 'operational', 'target_store' => 'mariadb', 'consumer' => '协同工单'], 'operations_replica.rpt.work_order_sub' => ['role' => 'operational', 'target_store' => 'mariadb', 'consumer' => '协同工单'], 'operations_replica.rpt.work_order_form_config' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '协同工单'], 'operations_replica.rpt.work_order_form_value' => ['role' => 'operational', 'target_store' => 'mariadb', 'consumer' => '协同工单'], 'jiansun.dbo.jst_workOrderInfo' => ['role' => 'operational', 'target_store' => 'mariadb', 'consumer' => '小额打款工单'], 'jiansun.dbo.jst_small_payment_order_map' => ['role' => 'operational', 'target_store' => 'mariadb', 'consumer' => '小额打款工单'], // Account bills and supplier pages are bounded serving datasets today. 'jiansun.dbo.jst_originalBillInfo.pinduoduo_receiving' => [ 'role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '店铺收款账单/拼多多账户', ], 'jiansun.dbo.jst_originalBillInfo.dewu_receiving' => [ 'role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '店铺收款账单/得物账户', ], 'jiansun.dbo.alipay_Bill_Detail' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '店铺收款账单/淘系支付宝账户'], 'jiansun.dbo.tmall_spread_bills' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '淘宝推广账单'], 'jiansun.dbo.pdd_spread_bills' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '拼多多推广账单'], 'jiansun.dbo.alibaba_bill' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '阿里巴巴账单'], 'jiansun.dbo.jd_spreadBills' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '京东推广账单'], 'jiansun.dbo.jd_costBills' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '京东钱包账单'], 'jiansun.dbo.fys_Ticketing_install_view' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '安装明细'], 'jiansun.dbo.fys_Ticketing_install_item' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '安装明细详情'], 'jiansun.dbo.finance_purchaseReturn' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '供应商退货对账'], 'jiansun.dbo.finance_invoiceDeduction' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '供应商发票扣款'], 'jiansun.dbo.fys_supplierPaymentSummary' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '供应商应付'], 'jiansun.dbo.finance_advanceLoans' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '借支明细'], 'jiansun.dbo.pm_unOrderDetails' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '未定价明细'], 'jiansun.dbo.finance_sampleDeduction' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '样品扣款'], 'jiansun.dbo.fys_express_courier_settlement' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '代发快递'], 'jiansun.dbo.jst_order_express_details' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '运费对账物流明细'], 'jiansun.dbo.Jst_SendData_View_extension' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '运费对账商品与收货区域'], 'jiansun.dbo.jst_salesOutboundInfo' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '运费对账出库运费'], 'jiansun.dbo.jst_inoutWater' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '三方仓进销存'], 'jiansun.dbo.jst_inoutWaterItem' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '三方仓进销存'], 'jiansun.dbo.jst_inventoryInfo' => ['role' => 'operational', 'target_store' => 'mariadb', 'consumer' => '三方仓进销存'], 'jiansun.dbo.finance_boardDeduction' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '板材扣款'], 'jiansun.dbo.pm_plainPlateData' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '素板资料'], 'jiansun.dbo.pm_boardPurchasePrice' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '板材采购价'], 'jiansun.dbo.pm_boardPriceChangeImport' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '板材调价'], 'jiansun.dbo.pm_boardApplyDetail' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '板材申请明细'], 'jiansun.dbo.pm_edgeBandData' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '封边条资料'], 'jiansun.dbo.pm_edgeBandApplyDetail' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '封边条明细'], 'jiansun.dbo.pm_edgeBandProfitInfo' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '封边条利润'], 'jiansun.dbo.finance_edgeBandDeductio' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '封边条扣款'], 'jiansun.dbo.pm_averageUnitPrice' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '平均单价'], 'jiansun.dbo.pm_boardInventoryDetail_snapshot' => ['role' => 'aggregate', 'target_store' => 'mariadb', 'consumer' => '板材库存'], 'jiansun.dbo.fys_supplierGoods_sttlement_purchase' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '货款采购对账'], 'jiansun.dbo.fys_supplierGoods_sttlement_sale' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '货款销售对账'], 'jiansun.dbo.pm_purchaseIn' => ['role' => 'serving_fact', 'target_store' => 'mariadb', 'consumer' => '采购入库'], 'jiansun.dbo.js_supplier_View' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '供应商管理'], 'jiansun.dbo.js_supplier_contract_View' => ['role' => 'operational', 'target_store' => 'mariadb', 'consumer' => '供应商管理/合同信息'], 'jiansun.dbo.js_supplier_linkers' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '供应商管理/联系信息'], 'jiansun.dbo.js_supplier_payinfo' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '供应商管理/打款信息'], 'jiansun.dbo.wp_express' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '快递资料'], 'jiansun.dbo.wp_express_expNet' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '快递网点'], 'jiansun.dbo.wp_express_account' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '快递打款账户'], 'jiansun.dbo.wp_express_extension' => ['role' => 'dimension', 'target_store' => 'mariadb', 'consumer' => '快递扩展资料'], ], 'special_tables' => [ 'store_report_bill_rows' => [ 'role' => 'fact', 'target_store' => 'clickhouse', 'consumer' => '店铺经营报表的可恢复原始层;页面只读日汇总', 'partition_column' => 'occurred_at', ], 'store_report_daily_rows' => [ 'role' => 'aggregate', 'target_store' => 'mariadb', 'consumer' => '店铺经营报表', ], 'store_report_paid_sales_rows' => [ 'role' => 'aggregate', 'target_store' => 'mariadb', 'consumer' => '店铺维度报表销量(业绩明细收入+优惠+冲减+退款金额合计)', ], ], ];