62 lines
2.1 KiB
PHP
62 lines
2.1 KiB
PHP
<?php
|
||
/**
|
||
* 触客宝 · 灌入演示 AI 获客客资(本地联调用)
|
||
* 用法:docker compose exec server php script/seed_ai_lead_demo.php [companyId]
|
||
*/
|
||
require __DIR__ . '/../thinkphp/base.php';
|
||
$app = new think\App();
|
||
$app->initialize();
|
||
|
||
$companyId = isset($argv[1]) ? (int)$argv[1] : 2130;
|
||
$now = time();
|
||
|
||
\app\chukebao\controller\AiLeadController::ingest([
|
||
'companyId' => $companyId,
|
||
'nickname' => '张先生·魔兽一键宏',
|
||
'phone' => '13800138001',
|
||
'unionId' => 'demo_lead_001',
|
||
'planName' => '场景获客·抖音口播',
|
||
'tags' => ['高意向', '魔兽玩家', '一键宏'],
|
||
'poolKeywordsText' => '一键宏,军训,解放双手',
|
||
'rfmLevel' => 'A',
|
||
'rfmScore' => 72,
|
||
'intention' => '咨询',
|
||
'behaviorTimeline' => [
|
||
['time' => date('Y-m-d H:i', $now - 3600), 'action' => '浏览落地页', 'detail' => '老坑爹一键宏介绍'],
|
||
['time' => date('Y-m-d H:i', $now - 1800), 'action' => '提交表单', 'detail' => '留下手机号'],
|
||
],
|
||
]);
|
||
|
||
\app\chukebao\controller\AiLeadController::ingest([
|
||
'companyId' => $companyId,
|
||
'nickname' => '李女士·暗黑代练',
|
||
'phone' => '13900139002',
|
||
'unionId' => 'demo_lead_002',
|
||
'planName' => '场景获客·京东群发',
|
||
'tags' => ['未添加', '暗黑3'],
|
||
'rfmLevel' => 'B',
|
||
'rfmScore' => 55,
|
||
'intention' => '比价',
|
||
'behaviorTimeline' => [
|
||
['time' => date('Y-m-d H:i', $now - 7200), 'action' => '点击广告', 'detail' => '暗黑破坏神代练'],
|
||
],
|
||
]);
|
||
|
||
\app\chukebao\controller\AiLeadController::ingest([
|
||
'companyId' => $companyId,
|
||
'nickname' => '王老板·工作室合作',
|
||
'phone' => '13700137003',
|
||
'unionId' => 'demo_lead_003',
|
||
'planName' => '场景获客·合伙人',
|
||
'tags' => ['B端', '合作'],
|
||
'rfmLevel' => 'S',
|
||
'rfmScore' => 88,
|
||
'intention' => '合作洽谈',
|
||
'behaviorTimeline' => [
|
||
['time' => date('Y-m-d H:i', $now - 600), 'action' => 'Webhook推送', 'detail' => '存客宝场景获客'],
|
||
],
|
||
]);
|
||
|
||
$count = think\Db::name('ai_lead')->where('companyId', $companyId)->count();
|
||
echo "OK companyId={$companyId} ai_lead total={$count}\n";
|