From 31da31b252da0f9ecdf78c1c6260208231a7580a Mon Sep 17 00:00:00 2001 From: wangjinlei <751475802@qq.com> Date: Tue, 3 Feb 2026 13:59:57 +0800 Subject: [PATCH] latex update --- application/api/controller/Preaccept.php | 6 ++++++ application/api/controller/Production.php | 17 ++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/application/api/controller/Preaccept.php b/application/api/controller/Preaccept.php index 77fd55a..50deb2f 100644 --- a/application/api/controller/Preaccept.php +++ b/application/api/controller/Preaccept.php @@ -45,6 +45,12 @@ class Preaccept extends Base }else{ $list[$k]['is_repeat'] = 0; } + if(strpos($v['refer_content'],'retraction')!==false||strpos($v['refer_content'],'retracted')!==false){ + $list[$k]['retract'] = 1; + }else{ + $list[$k]['retract'] = 0; + } + } $re["refers"] = $list; $re['repeat'] = empty($aRepeat) ? [] : $aRepeat; diff --git a/application/api/controller/Production.php b/application/api/controller/Production.php index 16135cf..7a0c684 100644 --- a/application/api/controller/Production.php +++ b/application/api/controller/Production.php @@ -632,6 +632,11 @@ class Production extends Base } else { $list[$k]['is_repeat'] = 0; } + if(strpos($v['refer_content'],'retraction')!==false||strpos($v['refer_content'],'retracted')!==false){ + $list[$k]['retract'] = 1; + }else{ + $list[$k]['retract'] = 0; + } } $re['refers'] = $list; $re['repeat'] = empty($aRepeat) ? [] : $aRepeat; @@ -2243,9 +2248,15 @@ class Production extends Base return jsonError($rule->getError()); } $info = $this->article_main_obj->where("am_id",$data['id'])->find(); + if(isset($data["code"])){ + $content = $data['code']; + }else{ + $content = $info['content']; + } + $production_info = $this->production_article_obj->where("article_id",$info['article_id'])->find(); $refers = $this->production_article_refer_obj->where("p_article_id",$production_info['p_article_id'])->where('state',0)->order("index")->select(); - $res = $this->convertToLatex($info['content'],$refers); + $res = $this->convertToLatex($content,$refers); echo $res; // return jsonSuccess([$res]); } @@ -2259,9 +2270,9 @@ class Production extends Base return ''; } //单行处理公式内容 - $pattern = '/^.*<\/wmath>$/'; + $pattern = '/^]*?\s+data-latex="([^"]*)"[^>]*?>.*?<\/wmath>$/'; if(preg_match($pattern, $content) === 1){ - $pattern1 = '//'; + $pattern1 = '/]*?\s+data-latex="([^"]*)">/'; if (preg_match($pattern1, $content, $matches)) { $latexContent = $matches[1]; // 将 $$ 转换为 $,因为equation环境不需要$$