作者 lyh
... ... @@ -119,6 +119,8 @@ class ProjectImport extends Command
}
}
$v[0] = $this->special2str($v[0]);
$total_count += 1;
try {
if ($task->type == ImportTask::TYPE_NEWS) {
... ... @@ -200,6 +202,30 @@ class ProjectImport extends Command
return false;
}
//特殊字符转换
protected function special2str($str)
{
if (strpos($str, ';') === false) {
return $str;
}
$list = [
'&lt;' => '<',
'&gt;' => '>',
'&amp;' => '&',
'&acute;' => "'",
'&quot;' => '"',
'&nbsp;' => ' ',
'&#x27;' => "'"
];
foreach ($list as $k => $v) {
$str = str_replace($k, $v, $str);
}
return $str;
}
//发送站内通知
protected function send_mail($user_list, $time, $type, $success_count, $repeat_count, $fail_count, $reason, $fail_line = [])
{
... ...
... ... @@ -98,6 +98,7 @@ class ProjectVisit extends Command
'ip' => $item['ip'] ?? '',
'depth' => $item['pv'],
'domain' => $url_arr['host'] ?? '',
'is_inquiry' => $item['is_cf'] ?? 0,
'created_at' => date('Y-m-d H:i:s', isset($item['update']) && $item['update'] ? $item['update'] : time()),
'updated_at' => date('Y-m-d H:i:s', isset($item['update']) && $item['update'] ? $item['update'] : time()),
'updated_date' => date('Y-m-d', isset($item['c_time']) && $item['c_time'] ? strtotime($item['c_time']) : time()),
... ...