1
This commit is contained in:
@@ -39,6 +39,10 @@ class Auto extends Controller {
|
||||
$this->reviewer_info_obj = Db::name('user_reviewer_info');
|
||||
}
|
||||
|
||||
public function phpinfo(){
|
||||
phpinfo();
|
||||
}
|
||||
|
||||
public function testEmail() {
|
||||
$journal_info = $this->journal_obj->where('journal_id', 4)->find();
|
||||
$maidata['email'] = "751475802@qq.com";
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use Mpdf\Mpdf;
|
||||
use think\Controller;
|
||||
use think\Db;
|
||||
use think\Queue;
|
||||
@@ -460,6 +461,44 @@ class Production extends Controller
|
||||
}
|
||||
|
||||
|
||||
public function eeeccc(){
|
||||
// $str = "Critical Care Medicine 2022;50 (6):955-63";
|
||||
// dump($this->bekjournal($str));
|
||||
$str = "Pandey S, Kumar P, Niranjan A, Verma H, Kumar M. Targeting biosignatures of hyperglycemia and oxidative stress in diabetes comorbid depressive rats: effectiveness of hydroethanolic extract of the whole plant of Ludwigia octovalvis. Tradit Med Res 2023;8 (2):9.";
|
||||
$res = explode('.',$str);
|
||||
echo $this->prgeAuthor($res[0]);
|
||||
}
|
||||
|
||||
public function creatpdf(){
|
||||
$path = ROOT_PATH . 'public' . DS . 'testpdf'.DS;
|
||||
$mpdf = new Mpdf(['mode'=>'utf-8','format'=>'A4']);
|
||||
$mpdf->SetDisplayMode('fullpage');
|
||||
$mpdf->autoScriptToLang = true;
|
||||
$mpdf->autoLangToFont = true;
|
||||
$fileUrl = $path.'1234.pdf';
|
||||
$mpdf->WriteHTML(file_get_contents($path.'meaut1.html'));
|
||||
$mpdf->Output($fileUrl,"D");
|
||||
}
|
||||
|
||||
|
||||
public function bekjournal($str){
|
||||
preg_match("/[0-9]{4}/",$str,$math);
|
||||
$year = $math[0];
|
||||
$frag[0]=trim(substr($str,0,stripos($str,$year))) ;
|
||||
$frag[1]=substr($str,stripos($str,$year));
|
||||
return $frag;
|
||||
}
|
||||
|
||||
public function prgeAuthor($author){
|
||||
$a = explode(',',$author);
|
||||
if(count($a)<7){
|
||||
return $author.'.';
|
||||
}else{
|
||||
return trim($a[0]).', '.trim($a[1]).', '.trim($a[2]).', et al.';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 排版主方法入口
|
||||
*/
|
||||
@@ -687,7 +726,8 @@ class Production extends Controller
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$old_article_author_info = $this->production_article_author_obj->where('p_article_author_id',$data['p_article_author_id'])->find();
|
||||
$updata['author_name'] = trim($data['first_name']) . ' ' . trim($data['last_name']);
|
||||
$article_info = $this->article_obj->where('article_id',$old_article_author_info['article_id'])->find();
|
||||
$updata['author_name'] = $article_info['journal_id']==21?trim($data['last_name']).trim($data['first_name']):trim($data['first_name']) . ' ' . trim($data['last_name']);
|
||||
$updata['first_name'] = trim($data['first_name']);
|
||||
$updata['last_name'] = trim($data['last_name']);
|
||||
$updata['orcid'] = isset($data['orcid']) ? $data['orcid'] : '';
|
||||
@@ -772,9 +812,11 @@ class Production extends Controller
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$p_info = $this->production_article_obj->where('p_article_id', $data['p_article_id'])->find();
|
||||
$article_info = $this->article_obj->where('article_id',$p_info['article_id'])->find();
|
||||
|
||||
$insert['p_article_id'] = $data['p_article_id'];
|
||||
$insert['article_id'] = $p_info['article_id'];
|
||||
$insert['author_name'] = trim($data['first_name']) . ' ' . trim($data['last_name']);
|
||||
$insert['author_name'] = $article_info['journal_id']==21?trim($data['last_name']).trim($data['first_name']):trim($data['first_name']) . ' ' . trim($data['last_name']);
|
||||
$insert['first_name'] = trim($data['first_name']);
|
||||
$insert['last_name'] = trim($data['last_name']);
|
||||
$insert['orcid'] = isset($data['orcid']) ? $data['orcid'] : '';
|
||||
@@ -905,6 +947,12 @@ class Production extends Controller
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
public function mytest11(){
|
||||
$r = $this->production_article_refer_obj->where('p_refer_id',8)->find();
|
||||
my_doiToFrag2($r);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证参考文献是否全部通过
|
||||
*/
|
||||
@@ -1101,16 +1149,14 @@ class Production extends Controller
|
||||
}else{
|
||||
$file = ROOT_PATH . 'public' . DS.'proofPDF'.DS.$p_info['article_id'].'.pdf';
|
||||
}
|
||||
|
||||
sendEmail($maidata['email'],$maidata['title'],$journal_info['title'],$maidata['content'],$maidata['tmail'],$maidata['tpassword'],$file);
|
||||
|
||||
//更改数据库
|
||||
$updata['proof_state'] = 1;
|
||||
$updata['proof_stime'] = time();
|
||||
$updata['proof_etime'] = strtotime("+2 day");
|
||||
$this->production_article_obj->where('p_article_id',$data['p_article_id'])->update($updata);
|
||||
|
||||
return jsonSuccess(['msg'=>$this->production_article_obj->getLastSql()]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1139,6 +1185,9 @@ class Production extends Controller
|
||||
if($data['code']==0){//同意
|
||||
$updata['proof_state'] = 2;
|
||||
}else{//拒绝
|
||||
if(trim($data['content'])==''){
|
||||
return jsonError('Content is required');
|
||||
}
|
||||
$updata['proof_state'] = 2;
|
||||
$updata['proof_content'] = trim($data['content']);
|
||||
}
|
||||
@@ -1155,7 +1204,6 @@ class Production extends Controller
|
||||
echo 'Commit Succeeded';
|
||||
}
|
||||
|
||||
|
||||
private function pdfAddProof($article_id)
|
||||
{
|
||||
$p_info = $this->production_article_obj->where('article_id',$article_id)->where('state',0)->find();
|
||||
@@ -1187,18 +1235,21 @@ class Production extends Controller
|
||||
// $pdf->Write(7, date('Y-m-d'));
|
||||
}
|
||||
$pdf->Output(ROOT_PATH . 'public' . DS.'proofPDF'.DS.$article_id.'.pdf');
|
||||
|
||||
|
||||
|
||||
if($p_info['file_sub']!=''&&substr($p_info['file_sub'],strripos($p_info['file_sub'],'.')+1)=='pdf'){
|
||||
$pdf1 = new \FPDI();
|
||||
$pageCount1 = $pdf1->setSourceFile(ROOT_PATH . 'public' . DS."articleSUB".DS.$p_info['file_sub']);
|
||||
for ($pageNo = 1; $pageNo <= $pageCount1; $pageNo++) {
|
||||
// import a page
|
||||
$templateId = $pdf1->importPage($pageNo);
|
||||
$templateId1 = $pdf1->importPage($pageNo);
|
||||
|
||||
// get the size of the imported page
|
||||
$size = $pdf1->getTemplateSize($templateId);
|
||||
$size = $pdf1->getTemplateSize($templateId1);
|
||||
|
||||
// create a page (landscape or portrait depending on the imported page size)
|
||||
if ($size['w'] > $size['h']) $pdf->AddPage('L', array($size['w'], $size['h']));
|
||||
if ($size['w'] > $size['h']) $pdf1->AddPage('L', array($size['w'], $size['h']));
|
||||
else $pdf1->AddPage('P', array($size['w'], $size['h']));
|
||||
|
||||
// use the imported page
|
||||
@@ -1206,7 +1257,7 @@ class Production extends Controller
|
||||
|
||||
$pdf1->image(ROOT_PATH . 'public' . DS.'pdf'.DS.'bg2.png',55, 25, 80);
|
||||
$pdf1->image(ROOT_PATH . 'public' . DS.'pdf'.DS.'bg2.png',55, 155, 80);
|
||||
$pdf1->useTemplate($templateId);
|
||||
$pdf1->useTemplate($templateId1);
|
||||
// $pdf->SetFont('Arial', 'B', '12');
|
||||
// // sign with current date
|
||||
// $pdf->SetXY(0, 0); // you should keep testing untill you find out correct x,y values
|
||||
@@ -1240,7 +1291,8 @@ class Production extends Controller
|
||||
private function authorFormate($p_article_id)
|
||||
{
|
||||
// $authors = $this->article_author_obj->where('article_id', $article_id)->where('state', 0)->select();
|
||||
|
||||
$p_info = $this->production_article_obj->where('p_article_id',$p_article_id)->find();
|
||||
$article_info = $this->article_obj->where('article_id',$p_info['article_id'])->find();
|
||||
$authors = $this->production_article_author_obj->where('p_article_id',$p_article_id)->where('state',0)->select();
|
||||
//组装地址数组
|
||||
$address = [];
|
||||
@@ -1269,7 +1321,7 @@ class Production extends Controller
|
||||
//构建数组字符串
|
||||
$author = '';
|
||||
foreach ($authors as $v) {
|
||||
$cache_str = trim($v['first_name']) . ' ' . trim($v['last_name']) . '<q>';
|
||||
$cache_str = $article_info['journal_id']==21?trim($v['last_name']).trim($v['first_name'])."<q>":trim($v['first_name']) . ' ' . trim($v['last_name']) . '<q>';
|
||||
$cac = $this->production_article_author_to_organ_obj
|
||||
->field('t_production_article_organ.*')
|
||||
->join('t_production_article_organ','t_production_article_organ.p_article_organ_id = t_production_article_author_to_organ.p_article_organ_id','left')
|
||||
|
||||
@@ -701,6 +701,19 @@ class Reviewer extends Controller
|
||||
return jsonError("Non repeatable review");
|
||||
}
|
||||
|
||||
//验证字数
|
||||
$content = $data['qu9contents']." ".$data['qu10contents']." ".$data['qu11contents']." ".$data['qu12contents']." ".$data['qu13contents']." ".$data['qu14contents']." ".$data['qu15contents']." ".$data['comment'];
|
||||
if(preg_match('/[\x{4e00}-\x{9fa5}]/u', $content)>0){//含有中文
|
||||
if(mb_strlen($content, 'UTF8')<60){
|
||||
return jsonError("We encourage you to enrich your comment further to help improve the peer paper (at least 60 words).");
|
||||
}
|
||||
}else{//不含中文
|
||||
$carray = explode(" ", $content);
|
||||
if(count($carray)<60){
|
||||
return jsonError("We encourage you to enrich your comment further to help improve the peer paper (at least 60 words).");
|
||||
}
|
||||
}
|
||||
|
||||
//组合insert数据,存储
|
||||
$insert_data['art_rev_id'] = $data['art_rev_id'];
|
||||
$insert_data['qu1'] = $data['qu1'];
|
||||
|
||||
Reference in New Issue
Block a user