diff --git a/application/api/controller/Preaccept.php b/application/api/controller/Preaccept.php
index 79794434..ce9e840b 100644
--- a/application/api/controller/Preaccept.php
+++ b/application/api/controller/Preaccept.php
@@ -782,7 +782,8 @@ class Preaccept extends Base
$title = trim((string)($summary['title'] ?? ''));
$jouraRaw = trim((string)($summary['joura'] ?? ''));
- $authorStr = trim((string)($summary['author_str'] ?? ''));
+ // 姓全写 + 名首字母,超过 3 个作者取前 3 个 + et al
+ $authorCitation = $svc->getAuthorsCitation($summary['raw'] ?? [], 3);
$dateno = trim((string)($summary['dateno'] ?? ''));
$doilink = trim((string)($summary['doilink'] ?? ''));
if ($doilink === '') {
@@ -790,7 +791,7 @@ class Preaccept extends Base
}
$f = [
- 'author' => $authorStr !== '' ? prgeAuthor($authorStr) : '',
+ 'author' => $authorCitation !== '' ? $authorCitation . '.' : '',
'title' => $title,
'joura' => $jouraRaw !== '' ? formateJournal($jouraRaw) : '',
'dateno' => str_replace(' ', '', str_replace('-', '–', $dateno)),
diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php
index 6d7bdf54..dbaf23de 100644
--- a/application/api/controller/Production.php
+++ b/application/api/controller/Production.php
@@ -3208,7 +3208,7 @@ class Production extends Base
$z = count($list);
$m = 0;
foreach ($list as $v) {
- if ($v['refer_frag'] != '' || $v['author'] != '') {
+ if ($v['refer_frag'] != '' || $v['author'] != ''|| $v['title'] != '') {
$m++;
}
}
@@ -3361,7 +3361,7 @@ class Production extends Base
$tt .= "Please carefully check the proof, including the text, figures, tables, references, author information, affiliations, spelling, and formatting. If any corrections are needed, please mark them clearly on the proof or submit comments through the system.
";
$tt .= "If we do not receive your confirmation by ".date("Y-m-d", strtotime("+3 days")).", the proof will be considered approved in its current form. Please note that no further revisions will be accepted after online confirmation.
";
$tt .= "Thank you for your time and cooperation. Should you have any questions, please feel free to contact us.
";
- $tt .= "Best regards,
Biomedical Engineering Communications
Email: bmec@tmrjournals.com
Website: https://www.tmrjournals.com/bmec/";
+ $tt .= "Best regards,
".$journal_info['title']."
Email: ".$journal_info['email']."
Website: ".$journal_info['website'];
// $maidata['email'] = '751475802@qq.com';
$maidata['email'] = $user_info['email'];
diff --git a/application/common/CrossrefService.php b/application/common/CrossrefService.php
index 699768fc..ca8c5483 100644
--- a/application/common/CrossrefService.php
+++ b/application/common/CrossrefService.php
@@ -300,6 +300,73 @@ class CrossrefService
return $authors;
}
+ /**
+ * 引用格式作者串:姓全写 + 名首字母,超过 $maxAuthors 个取前 N 个 + et al
+ * 例:Smith JA, Jones B, Lee C, et al
+ *
+ * @param array $aDoiInfo Crossref message
+ * @param int $maxAuthors 最多展示作者数,超过则截断加 et al
+ * @return string
+ */
+ public function getAuthorsCitation($aDoiInfo = [], $maxAuthors = 3)
+ {
+ $list = [];
+ if (!empty($aDoiInfo['author'])) {
+ foreach ($aDoiInfo['author'] as $author) {
+ $family = trim((string)($author['family'] ?? ''));
+ $given = trim((string)($author['given'] ?? ''));
+
+ if ($family === '' && $given === '') {
+ // 机构作者等无姓名结构的情况
+ $orgName = trim((string)($author['name'] ?? ''));
+ if ($orgName !== '') {
+ $list[] = $orgName;
+ }
+ continue;
+ }
+
+ $initials = $this->givenToInitials($given);
+ $name = $initials !== '' ? trim($family . ' ' . $initials) : $family;
+ if ($name !== '') {
+ $list[] = $name;
+ }
+ }
+ }
+
+ if (empty($list)) {
+ return '';
+ }
+
+ $maxAuthors = max(1, (int)$maxAuthors);
+ if (count($list) > $maxAuthors) {
+ $list = array_slice($list, 0, $maxAuthors);
+ return implode(', ', $list) . ', et al';
+ }
+
+ return implode(', ', $list);
+ }
+
+ /**
+ * 名转首字母:取每个组成部分(空格/连字符/点分隔)首字母大写并拼接。
+ * 例:"John A." -> "JA","Mary-Jane" -> "MJ"
+ */
+ private function givenToInitials($given)
+ {
+ $given = trim((string)$given);
+ if ($given === '') {
+ return '';
+ }
+ $parts = preg_split('/[\s\-\.]+/u', $given, -1, PREG_SPLIT_NO_EMPTY);
+ $initials = '';
+ foreach ($parts as $p) {
+ $first = mb_substr($p, 0, 1);
+ if ($first !== '') {
+ $initials .= mb_strtoupper($first);
+ }
+ }
+ return $initials;
+ }
+
/**
* 提取发表年份
*/
diff --git a/application/common/ProductionArticleRefer.php b/application/common/ProductionArticleRefer.php
index 706ec8ee..b61b42d1 100644
--- a/application/common/ProductionArticleRefer.php
+++ b/application/common/ProductionArticleRefer.php
@@ -2,6 +2,7 @@
namespace app\common;
use think\Db;
use think\Env;
+use app\common\CrossrefService;
class ProductionArticleRefer
{
@@ -78,6 +79,41 @@ class ProductionArticleRefer
return json_encode(['status' => 4,'msg' => 'Reference DOI is empty'.json_encode($aParam)]);
}
+
+ //开始用crossref接口的方式处理数据
+ $doiNorm = preg_replace('#^https?://(dx\.)?doi\.org/#i', '', $aRefer['refer_doi']);
+ $doiNorm = trim($doiNorm, " \t\n\r\0\x0B/");
+
+ $svc = new CrossrefService([
+ 'mailto' => trim((string)Env::get('crossref_mailto', '')),
+ ]);
+ $summary = $svc->fetchWorkSummary($doiNorm);
+ if ($summary !== null && !empty($summary['doi'])) {
+ $update_a = [];
+ $title = trim((string)($summary['title'] ?? ''));
+ $jouraRaw = trim((string)($summary['joura'] ?? ''));
+ // 姓全写 + 名首字母,超过 3 个作者取前 3 个 + et al
+ $authorCitation = $svc->getAuthorsCitation($summary['raw'] ?? [], 3);
+ $dateno = trim((string)($summary['dateno'] ?? ''));
+ $doilink = trim((string)($summary['doilink'] ?? ''));
+ $update_a['title'] = $title;
+ $update_a['author'] = $authorCitation !== '' ? $authorCitation . '.' : '';
+ $update_a['joura'] = $jouraRaw;
+ $update_a['dateno'] = $dateno;
+ $update_a['refer_type'] = "journal";
+ $update_a['is_ja'] = 1;
+ $update_a['doilink'] = $doilink;
+ $update_a['cs'] = 1;
+ $update_a['update_time'] = time();
+ $update_a['is_deal'] = 1;
+ Db::name('production_article_refer')->where(['p_refer_id' => $iPReferId])->limit(1)->update($update_a);
+ return json_encode(['status' => 1,'msg' => 'Update successful']);
+ }
+
+ //结束---用crossref接口的方式处理数据
+
+
+
//数据处理
$doi = str_replace('/', '%2F', $aRefer['refer_doi']);
$url = "https://citation.doi.org/format?doi=$doi&style=cancer-translational-medicine&lang=en-US";
diff --git a/application/common/service/LocalModelService.php b/application/common/service/LocalModelService.php
index 955bd98c..0f24cabe 100644
--- a/application/common/service/LocalModelService.php
+++ b/application/common/service/LocalModelService.php
@@ -27,7 +27,7 @@ use think\Env;
class LocalModelService
{
/** 上下文长度阈值(字符数):<= 用小模型,> 用大模型 */
- const CONTEXT_THRESHOLD = 3000;
+ const CONTEXT_THRESHOLD = 1000;
/** 请求超时(秒) */
const TIMEOUT = 120;