latex update

This commit is contained in:
wangjinlei
2026-02-03 13:59:57 +08:00
parent f9e29ad876
commit 31da31b252
2 changed files with 20 additions and 3 deletions

View File

@@ -45,6 +45,12 @@ class Preaccept extends Base
}else{ }else{
$list[$k]['is_repeat'] = 0; $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["refers"] = $list;
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat; $re['repeat'] = empty($aRepeat) ? [] : $aRepeat;

View File

@@ -632,6 +632,11 @@ class Production extends Base
} else { } else {
$list[$k]['is_repeat'] = 0; $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['refers'] = $list;
$re['repeat'] = empty($aRepeat) ? [] : $aRepeat; $re['repeat'] = empty($aRepeat) ? [] : $aRepeat;
@@ -2243,9 +2248,15 @@ class Production extends Base
return jsonError($rule->getError()); return jsonError($rule->getError());
} }
$info = $this->article_main_obj->where("am_id",$data['id'])->find(); $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(); $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(); $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; echo $res;
// return jsonSuccess([$res]); // return jsonSuccess([$res]);
} }
@@ -2259,9 +2270,9 @@ class Production extends Base
return ''; return '';
} }
//单行处理公式内容 //单行处理公式内容
$pattern = '/^<wmath\s+data-latex="([^"]*)">.*<\/wmath>$/'; $pattern = '/^<wmath[^>]*?\s+data-latex="([^"]*)"[^>]*?>.*?<\/wmath>$/';
if(preg_match($pattern, $content) === 1){ if(preg_match($pattern, $content) === 1){
$pattern1 = '/<wmath\s+data-latex="([^"]*)">/'; $pattern1 = '/<wmath[^>]*?\s+data-latex="([^"]*)">/';
if (preg_match($pattern1, $content, $matches)) { if (preg_match($pattern1, $content, $matches)) {
$latexContent = $matches[1]; $latexContent = $matches[1];
// 将 $$ 转换为 $因为equation环境不需要$$ // 将 $$ 转换为 $因为equation环境不需要$$