1
This commit is contained in:
@@ -1425,7 +1425,7 @@ class Article extends Base
|
||||
|
||||
//如果是免费的期刊文章,那么直接变成付款完成
|
||||
if($journal_info['fee']==0||$article_info['ctime']<1735660800){
|
||||
$this->article_obj->where("article_id",$article_info['article_id'])->update(["is_bug"=>1]);
|
||||
$this->article_obj->where("article_id",$article_info['article_id'])->update(["is_buy"=>1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -507,17 +507,18 @@ class Base extends Controller
|
||||
if (in_array(strtolower($extension), ['jpg', 'jpeg', 'png'])) {
|
||||
// 处理图片文件
|
||||
file_put_contents($base_url . $newFileName, $fileContent);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['url'] = $article_id . "/" . $newFileName;
|
||||
$insert['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert);
|
||||
$insert11['article_id'] = $article_id;
|
||||
$insert11['url'] = $article_id . "/" . $newFileName;
|
||||
$insert11['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert11);
|
||||
} elseif (in_array(strtolower($extension), ['tiff', 'tif'])) {
|
||||
// 处理 TIFF 和 EMF 文件并转换为 JPG
|
||||
file_put_contents($base_url . $newFileName, $fileContent);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['url'] = $this->crossTifToPng($article_id . "/" . $newFileName);
|
||||
$insert['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert);
|
||||
$insert2['article_id'] = $article_id;
|
||||
$crre = $this->crossTifToPng($article_id . "/" . $newFileName);
|
||||
$insert2['url'] = $crre==null?"":$crre;
|
||||
$insert2['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert2);
|
||||
} elseif ($extension == "docx") {
|
||||
$word_dir = ROOT_PATH . "public/articleCache/" . $article_id;
|
||||
if (!is_dir($word_dir)) {
|
||||
@@ -535,10 +536,10 @@ class Base extends Controller
|
||||
$file_runs = $res['data']['list'];
|
||||
foreach ($file_runs as $val) {
|
||||
$ex = pathinfo($val,PATHINFO_EXTENSION);
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['url'] = ($ex=="tif"||$ex=="tiff")?crossTifToPng($val):$val;
|
||||
$insert['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert);
|
||||
$insert3['article_id'] = $article_id;
|
||||
$insert3['url'] = ($ex=="tif"||$ex=="tiff")?crossTifToPng($val):$val;
|
||||
$insert3['ctime'] = time();
|
||||
$this->article_main_image_obj->insert($insert3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -464,8 +464,7 @@ class Preaccept extends Base
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>"require",
|
||||
"am_id"=>"require",
|
||||
"content"=>"require"
|
||||
"am_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
@@ -479,7 +478,9 @@ class Preaccept extends Base
|
||||
if(isset($data['remark'])&&$data['remark']!=""){
|
||||
$insert["remark"] = $data['remark'];
|
||||
}
|
||||
$insert["content"] = $data['content'];
|
||||
if(isset($data['content'])&&$data['content']!=""){
|
||||
$insert["content"] = $data['content'];
|
||||
}
|
||||
$insert['ctime'] = time();
|
||||
$this->article_main_check_obj->insert($insert);
|
||||
return jsonSuccess([]);
|
||||
@@ -693,6 +694,23 @@ class Preaccept extends Base
|
||||
}
|
||||
|
||||
|
||||
public function myCreatMains(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
"article_id"=>"require"
|
||||
]);
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
|
||||
$mains = $this->article_main_obj->where("article_id",$data['article_id'])->whereIn("state",[0,2])->order("sort asc")->select();
|
||||
if(!$mains) {
|
||||
$this->addArticleMainEx($data["article_id"]);
|
||||
}
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
|
||||
public function getArticleMains(){
|
||||
$data = $this->request->post();
|
||||
$rule = new Validate([
|
||||
@@ -745,7 +763,7 @@ class Preaccept extends Base
|
||||
if($n_list[0]['type']>0||$n_list[0]['content']!=""){
|
||||
$this->addBRow($am_info['article_id'],$data['am_id']);
|
||||
}
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>1]);
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h1"=>1,"content"=>"<b><i>".$am_info['content']."</i></b>"]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -763,7 +781,7 @@ class Preaccept extends Base
|
||||
if($p_list[0]['type']>0||$p_list[0]['content']!=""){
|
||||
$this->addBRow($am_info['article_id'],$p_list[0]['am_id']);
|
||||
}
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h2"=>1]);
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h2"=>1,"content"=>"<b>".$am_info['content']."</b>"]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -775,7 +793,8 @@ class Preaccept extends Base
|
||||
if(!$rule->check($data)){
|
||||
return jsonError($rule->getError());
|
||||
}
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h3"=>1]);
|
||||
$am_info = $this->article_main_obj->where("am_id",$data['am_id'])->find();
|
||||
$this->article_main_obj->where("am_id",$data['am_id'])->update(["is_h3"=>1,"content"=>"<b>".$am_info['content']."</b>"]);
|
||||
return jsonSuccess([]);
|
||||
}
|
||||
|
||||
@@ -795,7 +814,7 @@ class Preaccept extends Base
|
||||
|
||||
private function addBRow($article_id,$am_id){
|
||||
if($am_id==0){//顶行
|
||||
$this->article_main_obj->where("article_id",$article_id)->inc("sort",1);
|
||||
$this->article_main_obj->where("article_id",$article_id)->inc("sort",1)->update();
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['content'] = "";
|
||||
$insert['sort'] = 1;
|
||||
@@ -803,7 +822,7 @@ class Preaccept extends Base
|
||||
$this->article_main_obj->insert($insert);
|
||||
}else{
|
||||
$am_info = $this->article_main_obj->where("am_id",$am_id)->find();
|
||||
$this->article_main_obj->where("article_id",$article_id)->where("sort",">",$am_info['sort'])->inc("sort",1);
|
||||
$this->article_main_obj->where("article_id",$article_id)->where("sort",">",$am_info['sort'])->inc("sort",1)->update();
|
||||
$insert['article_id'] = $article_id;
|
||||
$insert['content'] = "";
|
||||
$insert['sort'] = $am_info['sort']+1;
|
||||
|
||||
@@ -726,12 +726,14 @@ function my_doiToFrag2($data)
|
||||
$update = [];
|
||||
if ($frag == "") {
|
||||
$update['refer_frag'] = $data['refer_content'];
|
||||
$update['refer_type'] = "other";
|
||||
} else {
|
||||
// preg_match("/[0-9]{4}/",$frag,$math);
|
||||
// $year = $math[0];
|
||||
// $qbj=trim(substr($frag,0,stripos($frag,$year))) ;
|
||||
if (mb_substr_count($frag, '.') != 3) {
|
||||
$f = $frag . " Available at: " . PHP_EOL . "http://doi.org/" . $data['refer_doi'];
|
||||
$update['refer_type'] = "other";
|
||||
$update['refer_frag'] = $f;
|
||||
$update['cs'] = 1;
|
||||
} else {
|
||||
@@ -744,6 +746,7 @@ function my_doiToFrag2($data)
|
||||
$is_js = 0;
|
||||
if ($joura == trim($bj[0])) {
|
||||
}
|
||||
$update['refer_type'] = "journal";
|
||||
$update['is_ja'] = $joura == trim($bj[0]) ? 0 : 1;
|
||||
$update['dateno'] = str_replace(' ', '', str_replace('-', '–', trim($bj[1])));
|
||||
$update['doilink'] = strpos($data['refer_doi'],"http")===false?"http://doi.org/" . $data['refer_doi']:$data['refer_doi'];
|
||||
|
||||
Reference in New Issue
Block a user