作者 lyh

gx生成评论

... ... @@ -73,17 +73,18 @@ class InitKeywordComment extends Command
$item = str_replace("'", '"', $item);
// 解码成 PHP 关联数组
$item = json_decode($item, true);
dd($item);
$data[] = [
'nickname'=>$item['name'],
'text'=>$item['comment'],
'project_id'=>$project_id,
'type'=>1,
'uid'=>0,
];
var_dump($item);
// $data[] = [
// 'nickname'=>$item['name'],
// 'text'=>$item['comment'],
// 'project_id'=>$project_id,
// 'type'=>1,
// 'uid'=>0,
// ];
}
$keywordCommonModel = new AggregateKeywordComment();
$keywordCommonModel->insertAll($data);
die();
// $keywordCommonModel = new AggregateKeywordComment();
// $keywordCommonModel->insertAll($data);
}
return true;
}
... ...