$this->getPlatform()->id, 'company_id' => $this->getCompany()->id, 'store_id' => $this->getStore()->id, 'unique_id' => $record['unique_id'] ?? $this->getData()['unique_id'] ?? null, 'raw_data' => json_encode($record), // 根据实际业务需求映射其他字段 // 例如: // 'order_id' => $record['order_id'] ?? null, // 'order_status' => $record['order_status'] ?? null, // 'order_amount' => $record['order_amount'] ?? 0, // ... ]; } }); } /** * 可选:覆盖唯一标识符提取逻辑 * * 如果使用默认的 unique_id 提取逻辑,则无需覆盖此方法 */ // public function entityUniqueIdentifierExtract(array $metadata): string|int // { // return $metadata['custom_id_field'] ?? throw new InvalidArgumentException('custom_id_field not found'); // } }