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