Files
journal/application/master/service/push/ScopusPusher.php

38 lines
1.1 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
namespace app\master\service\push;
use app\master\service\XmlBuilder;
/**
* Scopus (Elsevier) 推送器
* 为每篇文章生成 XML连同 PDF 通过 SFTP 上传到 Elsevier。
* 逻辑迁移自 Datebase::scopusPushXMLSFTP 复用 common.php 的 pushSFTPForScopus。
*/
class ScopusPusher extends AbstractPusher
{
public function code()
{
return 'scopus';
}
public function label()
{
return 'Scopus (Elsevier)';
}
public function pushStage($stage_id, array $options = [])
{
$list = $this->article_obj->where("journal_stage_id", $stage_id)->where("state", 0)->select();
$stage_info = $this->journal_stage_obj->where("journal_stage_id", $stage_id)->find();
$count = 0;
foreach ($list as $v) {
XmlBuilder::forArticle($v['article_id']);
$file = substr($v['doi'], strpos($v['doi'], "/") + 1) . ".xml";
pushSFTPForScopus($file, $v['file_pdf'], $stage_info);
$count++;
}
return PushResult::success("Scopus 已上传 {$count} 篇文章的 XML/PDF");
}
}